jrpc

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorRpcNotConnected = errors.New("rpc not connected")
)

Functions

func CallItem

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

* * CallItem * @param method string, args et.Json * @return et.Item, error *

func CallItems

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

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

func CallJson

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

* * CallJson * @param method string, args et.Json * @return et.Json, error *

func CallList

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

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

func CallRpc added in v1.0.12

func CallRpc(address string, method string, args any, reply any) error

* * CallRpc: Calls a remote procedure * @param address string, method string, args any, reply any * @return error *

func Close

func Close()

* * Close *

func HttpCalcItem added in v0.1.0

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

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

func HttpListRouters added in v1.0.11

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

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

func Load

func Load(name string) error

* * load *

func Mount

func Mount(host string, services any) (map[string]et.Json, error)

func Start added in v0.1.0

func Start(port int) error

* * Start * @param port int *

Types

type Package

type Package struct {
	Name    string    `json:"name"`
	Host    string    `json:"host"`
	Port    int       `json:"port"`
	Solvers []*Solver `json:"routes"`
	// contains filtered or unexported fields
}

func LoadTo added in v0.1.0

func LoadTo(name, host string, port int) (*Package, error)

func NewPackage added in v0.1.16

func NewPackage(name string, host string, port int) *Package

* * NewPackage * @param name string, host string, port int * @return *Package *

func (*Package) Describe added in v0.1.0

func (s *Package) Describe() et.Json

* * Describe * @return et.Json *

type Solver

type Solver struct {
	Host       string   `json:"host"`
	Port       int      `json:"port"`
	StructName string   `json:"structName"`
	Method     string   `json:"method"`
	Inputs     et.Json  `json:"inputs"`
	Output     []string `json:"output"`
}

type Storage added in v0.1.1

type Storage struct {
	Packages []*Package
}

Jump to

Keyboard shortcuts

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