Documentation ¶
Index ¶
- Constants
- Variables
- func Call(ctx context.Context, addr, method string, params interface{}) (map[string]interface{}, error)
- func CallById(context context.Context, id, method string, params interface{}) (map[string]interface{}, error)
- func Register(name string, method Method)
- func Show(context context.Context, id string) (map[string]interface{}, error)
- func ShowAll(context context.Context) ([]map[string]interface{}, error)
- func Start(address string) (net.Addr, error)
- type Handler
- type Method
Constants ¶
View Source
const (
// DefaultAddress is the network address used by the rpc server if none is given.
DefaultAddress = "127.0.0.1:0"
)
Variables ¶
View Source
var (
InstancePidFile = "pid"
)
Functions ¶
func Call ¶
func Call(ctx context.Context, addr, method string, params interface{}) (map[string]interface{}, error)
Call initiates a JSON-RPC call to a given rpc server address, using the specified method and waits for the response.
func CallById ¶
func CallById(context context.Context, id, method string, params interface{}) (map[string]interface{}, error)
CallById returns the response of a remote procedure call made against another mole instance, given its id or alias.
Types ¶
type Method ¶
type Method func(params interface{}) (json.RawMessage, error)
Method represents a procedure that can be called remotely.
Click to show internal directories.
Click to hide internal directories.