rpc

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeCall stream.MessageType = "call"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	ID     CallID          `json:"id"`
	Method CallMethod      `json:"method"`
	Params json.RawMessage `json:"params"`
}

type CallDispatcher

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

func NewCallDispatcher

func NewCallDispatcher() *CallDispatcher

func (*CallDispatcher) Handle

func (d *CallDispatcher) Handle(
	ctx context.Context,
	msg stream.Message,
	reply chan<- stream.Message,
) error

func (*CallDispatcher) RegisterCallHandler

func (d *CallDispatcher) RegisterCallHandler(method CallMethod, handler CallHandler)

type CallHandler

type CallHandler interface {
	Handle(ctx context.Context, call Call, reply chan<- stream.Message) error
}

type CallID

type CallID string

type CallMethod

type CallMethod string

Directories

Path Synopsis
kube

Jump to

Keyboard shortcuts

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