chore: Remove unused imports
- Remove 'os' import from heromodels - Remove 'json' and 'x.json2' imports from openrpc - Remove 'console' import from openrpc - Remove unused imports in multiple modules
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
module heromodels
|
module heromodels
|
||||||
|
|
||||||
import freeflowuniverse.herolib.hero.heroserver
|
import freeflowuniverse.herolib.hero.heroserver
|
||||||
import os
|
|
||||||
|
|
||||||
// Start heromodels server using heroserver
|
// Start heromodels server using heroserver
|
||||||
@[params]
|
@[params]
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import json
|
|||||||
import net.http
|
import net.http
|
||||||
import veb
|
import veb
|
||||||
import freeflowuniverse.herolib.schemas.jsonrpc
|
import freeflowuniverse.herolib.schemas.jsonrpc
|
||||||
import freeflowuniverse.herolib.ui.console
|
|
||||||
|
|
||||||
@['/auth/:action']
|
@['/auth/:action']
|
||||||
pub fn (mut server HeroServer) auth_handler(mut ctx Context, action string) !veb.Result {
|
pub fn (mut server HeroServer) auth_handler(mut ctx Context, action string) !veb.Result {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ pub fn (pw Procedure[T, U]) handle(request Request) !Response {
|
|||||||
data: '${request.params}'
|
data: '${request.params}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result := pw.function(payload) or {
|
_ := pw.function(payload) or {
|
||||||
return RPCError{
|
return RPCError{
|
||||||
code: -32603
|
code: -32603
|
||||||
message: 'Error in function on rpc request.'
|
message: 'Error in function on rpc request.'
|
||||||
@@ -115,7 +115,7 @@ pub fn (pw Procedure[T, U]) handle(request Request) !Response {
|
|||||||
|
|
||||||
pub fn (pw ProcedureVoid[T]) handle(request Request) !Response {
|
pub fn (pw ProcedureVoid[T]) handle(request Request) !Response {
|
||||||
payload := decode_payload[T](request.params) or { return invalid_params }
|
payload := decode_payload[T](request.params) or { return invalid_params }
|
||||||
result := pw.function(payload) or {
|
_ := pw.function(payload) or {
|
||||||
return RPCError{
|
return RPCError{
|
||||||
code: -32603
|
code: -32603
|
||||||
message: 'Error in function on rpc request.'
|
message: 'Error in function on rpc request.'
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import json
|
|
||||||
import x.json2
|
|
||||||
import freeflowuniverse.herolib.schemas.jsonschema
|
import freeflowuniverse.herolib.schemas.jsonschema
|
||||||
|
|
||||||
// In Method struct
|
// In Method struct
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import x.json2
|
|
||||||
|
|
||||||
// encode encodes an OpenRPC document struct into json string.
|
// encode encodes an OpenRPC document struct into json string.
|
||||||
// eliminates undefined variable by calling prune on the initial encoding.
|
// eliminates undefined variable by calling prune on the initial encoding.
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
|
||||||
|
|
||||||
@[params]
|
@[params]
|
||||||
pub struct Params {
|
pub struct Params {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
|
||||||
|
|
||||||
// path to openrpc.json file
|
// path to openrpc.json file
|
||||||
pub fn new_handler(openrpc_path string) !Handler {
|
pub fn new_handler(openrpc_path string) !Handler {
|
||||||
mut openrpc_handler := Handler{
|
mut openrpc_handler := Handler{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import x.json2 as json { Any }
|
|
||||||
import freeflowuniverse.herolib.schemas.jsonschema { Reference, SchemaRef }
|
import freeflowuniverse.herolib.schemas.jsonschema { Reference, SchemaRef }
|
||||||
|
|
||||||
// This is the root object of the OpenRPC document.
|
// This is the root object of the OpenRPC document.
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
module openrpc
|
module openrpc
|
||||||
|
|
||||||
import json
|
|
||||||
import x.json2
|
|
||||||
import net.unix
|
import net.unix
|
||||||
import os
|
import os
|
||||||
import freeflowuniverse.herolib.ui.console
|
import freeflowuniverse.herolib.ui.console
|
||||||
|
|||||||
Reference in New Issue
Block a user