jsonrpc

package
Version: v0.0.0-...-d197761 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// methods to manage exec life cycle
	CreateMethod         = "create"
	CheckMethod          = "check"
	ResizeMethod         = "resize"
	ListContainersMethod = "listContainers"
)

Constants that represent RPC methods identifiers.

View Source
const (
	// BearerTokenAttr attribute name.
	BearerTokenAttr = "bearerToken"
)

Variables

View Source
var RPCRoutes = jsonrpc.RoutesGroup{
	Name: "Json-rpc MachineExec Routes",
	Items: []jsonrpc.Route{
		{
			Method: CreateMethod,
			Decode: jsonrpc.FactoryDec(func() interface{} { return &model.MachineExec{} }),
			Handle: jsonRpcCreateExec,
		},
		{
			Method: CheckMethod,
			Decode: jsonrpc.FactoryDec(func() interface{} { return &IdParam{} }),
			Handle: jsonRpcCheckExec,
		},
		{
			Method: ResizeMethod,
			Decode: jsonrpc.FactoryDec(func() interface{} { return &ResizeParam{} }),
			Handle: jsonrpc.HandleRet(jsonRpcResizeExec),
		},
		{
			Method: ListContainersMethod,
			Decode: jsonrpc.FactoryDec(func() interface{} { return nil }),
			Handle: jsonRpcListContainersExec,
		},
	},
}

RPCRoutes defines json-rpc exec api. This api uses to manage exec's life cycle.

Functions

This section is empty.

Types

type IdParam

type IdParam struct {
	Id int `json:"id"`
}

type OperationResult

type OperationResult struct {
	Id   int    `json:"id"`
	Text string `json:"text"`
}

type ResizeParam

type ResizeParam struct {
	Id   int  `json:"id"`
	Cols uint `json:"cols"`
	Rows uint `json:"rows"`
}

Jump to

Keyboard shortcuts

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