jrpc

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_PACKAGE_NOT_FOUND = "RPC package not load"
	ERR_SERVER_NOT_FOUND  = "RPC server not found"
	ERR_METHOD_NOT_FOUND  = "Method not found - %s"
	ERR_ENV_REQUIRED      = "Environment RPC_HOST required"
)
View Source
const RPC_KEY = "apigateway-rpc"

Variables

This section is empty.

Functions

func Call

func Call(method string, data et.Json) (et.Item, error)

* * Call * @param method string * @param data et.Json * @return et.Item * @return error *

func CallAny added in v1.1.8

func CallAny(method string, data et.Json) (any, error)

* * CallAny * @param method string * @param data et.Json * @return et.List * @return error *

func CallItems added in v1.1.8

func CallItems(method string, data et.Json) (et.Items, error)

* * CallItems * @param method string * @param data et.Json * @return et.Items * @return error *

func CallList added in v1.1.8

func CallList(method string, data et.Json) (et.List, error)

* * CallItems * @param method string * @param data et.Json * @return et.List * @return error *

func Close

func Close()

* * Close *

func GetRouters

func GetRouters() (et.Items, error)

* * GetRouters * @return et.Items * @return error *

func HttpCallRPC added in v1.1.0

func HttpCallRPC(w http.ResponseWriter, r *http.Request)

* * HttpCallRPC * @param w http.ResponseWriter * @param r *http.Request *

func Mount

func Mount(services any) error

* * Mount * @param host string * @param port int * @param service any *

func Start added in v1.1.7

func Start() error

* * Start *

func UnMount

func UnMount() error

* * UnMount * @return error *

Types

type Package added in v1.1.7

type Package struct {
	Name    string             `json:"name"`
	Host    string             `json:"host"`
	Port    int                `json:"port"`
	Solvers map[string]*Solver `json:"routes"`
}

func Load

func Load(name string) (*Package, error)

* * load *

func (*Package) Save added in v1.1.7

func (s *Package) Save() error

* * Save * @return error *

type Solver added in v1.1.7

type Solver struct {
	PackageName string   `json:"packageName"`
	Host        string   `json:"host"`
	Port        int      `json:"port"`
	Method      string   `json:"method"`
	Inputs      []string `json:"inputs"`
	Output      []string `json:"outputs"`
}

func GetSolver

func GetSolver(method string) (*Solver, error)

* * GetSolver * @param method string * @return *Solver * @return error *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL