jrpc

package
v1.1.76 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 17 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"
	MSG_PACKAGE_NOT_FOUND = "Package not found"
	MSG_PACKAGE_DELETE    = "Package deleted"
	MSG_INVALID_RESPONSE  = "Invalid response - %s"
	MSG_NOT_LOAD_CONFIG   = "Not load config - stage:%s name:%s"
)
View Source
const RPC_KEY = "apigateway-rpc"

Variables

This section is empty.

Functions

func CallItem added in v1.1.20

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

* * CallItem * @param method string * @param data et.Json * @return et.Item * @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.Item * @return error *

func CallJson added in v1.1.20

func CallJson(method string, data et.Json) (et.Json, error)

* * CallJson * @param method string * @param data et.Json * @return et.Json * @return error *

func CallList added in v1.1.8

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

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

func CallPermitios added in v1.1.20

func CallPermitios(method string, data et.Json) (map[string]bool, error)

* * CallPermitios * @param method string * @param data et.Json * @return map[string]bool * @return error *

func Close

func Close()

* * Close *

func DeleteRouters added in v1.1.16

func DeleteRouters(host, packageName string) (et.Item, error)

* * DeleteRouters * @param host string * @param packageName string * @return et.Item * @return error *

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 UnMount

func UnMount(host, name string) 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 *

func (*Package) Start added in v1.1.18

func (s *Package) Start() error

* * Start *

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