rpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonRpcEnvelope

type JsonRpcEnvelope struct {
	Method  types.CommandType `json:"method"`
	JsonRpc string            `json:"jsonrpc"`
	Id      int               `json:"id"`
}

type JsonRpcMessage

type JsonRpcMessage[T RpcRawParams] struct {
	JsonRpcEnvelope
	Params T `json:"params"`
}

func NewJsonRpcMessage

func NewJsonRpcMessage[T RpcRawParams](method types.CommandType, id int, params T) *JsonRpcMessage[T]

type JsonRpcMessageRaw

type JsonRpcMessageRaw struct {
	JsonRpcEnvelope
	Params json.RawMessage `json:"params"`
}

type JsonRpcResult

type JsonRpcResult struct {
	// contains filtered or unexported fields
}

func NewJsonRpcResult

func NewJsonRpcResult(id int, err error, result interfaces.Output) *JsonRpcResult

func (*JsonRpcResult) JsonMarshall

func (j *JsonRpcResult) JsonMarshall(ctx context.Context, outFormat OutFormat) ([]byte, error)

type OutFormat

type OutFormat string
var (
	OutFormatUnknown  OutFormat = ""
	OutFormatString   OutFormat = "string"
	OutFormatDetailed OutFormat = "detailed"
	OutFormatJson     OutFormat = "json"
)

func ParseOutFormat

func ParseOutFormat(s string) OutFormat

func (OutFormat) String

func (o OutFormat) String() string

type RpcRawParams

type RpcRawParams interface {
	GetMethod() types.CommandType
	UnRaw() (executor.RunCommand, error)
}

Jump to

Keyboard shortcuts

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