transport

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientContext

func NewClientContext(ctx context.Context, info ClientInfo) context.Context

func NewServerContext

func NewServerContext(ctx context.Context, info ServerInfo) context.Context

Types

type CallOption

type CallOption func(o *options)

type Client

type Client interface {
	Use(selector string, mws ...middleware.Middleware)
	//Invoke(ctx context.Context, method string, req interface{}, resp interface{}, opts ...CallOption) error
	Close() error
}

Client is a transport client interface.

type ClientInfo

type ClientInfo struct {
	Type   string
	Target string
	Op     *xrpc.Operation
}

func FromClientContext

func FromClientContext(ctx context.Context) (info ClientInfo, ok bool)

type ErrorConverter

type ErrorConverter interface {
	// FromRPCError converts RPC error to a transport error.
	FromRPCError(err error) error
	// ToRPCError converts ngo error to rpc error.
	ToRPCError(err error) error
}

ErrorConverter .

type Server

type Server interface {
	Use(selector string, mws ...middleware.Middleware)
	Start() error
	Healthz(ctx context.Context) bool
	Online(ctx context.Context) error
	Offline(ctx context.Context) error
	Stop()
	GracefulStop()
}

Server is a transport server interface.

type ServerInfo

type ServerInfo struct {
	Type string
	Op   *xrpc.Operation
	Peer *xrpc.Peer
}

func FromServerContext

func FromServerContext(ctx context.Context) (info ServerInfo, ok bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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