client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnStateChanged

func OnStateChanged(disp *dispatch.Dispatcher, stateListener *dispatch.StateListener)

Types

type AuthorizedCallback

type AuthorizedCallback func()

type CallOption

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

type CallOptionFunc

type CallOptionFunc func(opt *CallOption)

func WithBroadcast

func WithBroadcast(b bool) CallOptionFunc

func WithTraceId

func WithTraceId(traceId string) CallOptionFunc

type ConnectedCallback

type ConnectedCallback func()

type ConnectionLostCallback

type ConnectionLostCallback func()

type LiveCallback

type LiveCallback func(jsonrpc.IMessage)

type LivecallT

type LivecallT struct {
	Expire   time.Time
	Request  *jsonrpc.RequestMessage
	Callback LiveCallback
}

type MethodUpdateReceiver

type MethodUpdateReceiver chan []*intf.MethodInfo

type RPCClient

type RPCClient struct {
	LiveRetryTimes int
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(serverEntry ServerEntry) *RPCClient

func (*RPCClient) CallGRPCMessage

func (self *RPCClient) CallGRPCMessage(rootCtx context.Context, reqmsg jsonrpc.IMessage, opts ...CallOptionFunc) (jsonrpc.IMessage, error)

func (*RPCClient) CallHTTPMessage

func (self *RPCClient) CallHTTPMessage(rootCtx context.Context, reqmsg jsonrpc.IMessage, opts ...CallOptionFunc) (jsonrpc.IMessage, error)

func (*RPCClient) CallMessage

func (self *RPCClient) CallMessage(rootCtx context.Context, reqmsg jsonrpc.IMessage, opts ...CallOptionFunc) (jsonrpc.IMessage, error)

func (*RPCClient) CallRPC

func (self *RPCClient) CallRPC(rootCtx context.Context, method string, params []interface{}, opts ...CallOptionFunc) (jsonrpc.IMessage, error)

func (*RPCClient) CheckStatus

func (self *RPCClient) CheckStatus(status *intf.Status, methodName string) error

func (RPCClient) ClientAuth

func (self RPCClient) ClientAuth() *intf.ClientAuth

func (*RPCClient) Connect

func (self *RPCClient) Connect() error

func (RPCClient) Connected

func (self RPCClient) Connected() bool

func (*RPCClient) DeclareDelegates

func (self *RPCClient) DeclareDelegates(rootCtx context.Context, methods []string) error

func (RPCClient) IsH2

func (self RPCClient) IsH2() bool

func (RPCClient) IsHttp

func (self RPCClient) IsHttp() bool

func (RPCClient) IsSecure

func (self RPCClient) IsSecure() bool

func (*RPCClient) ListDelegates

func (self *RPCClient) ListDelegates(rootCtx context.Context) ([]string, error)

func (*RPCClient) ListMethods

func (self *RPCClient) ListMethods(rootCtx context.Context) ([]*intf.MethodInfo, error)

func (*RPCClient) Live

func (self *RPCClient) Live(rootCtx context.Context, disp *dispatch.Dispatcher) error

func (*RPCClient) LiveCall

func (self *RPCClient) LiveCall(rootCtx context.Context, reqmsg *jsonrpc.RequestMessage, callback LiveCallback, opts ...CallOptionFunc) error

func (*RPCClient) NewAuthRequest

func (self *RPCClient) NewAuthRequest() *jsonrpc.RequestMessage

func (*RPCClient) NewWatchStateRequest

func (self *RPCClient) NewWatchStateRequest() *jsonrpc.RequestMessage

func (*RPCClient) OnAuthorized

func (self *RPCClient) OnAuthorized(cb AuthorizedCallback)

func (*RPCClient) OnConnected

func (self *RPCClient) OnConnected(cb ConnectedCallback)

func (*RPCClient) OnConnectionLost

func (self *RPCClient) OnConnectionLost(cb ConnectionLostCallback)

func (*RPCClient) OnHandlerChanged

func (self *RPCClient) OnHandlerChanged(disp *dispatch.Dispatcher)

Override Handler.OnHandlerChanged

func (*RPCClient) SendGRPCNotify

func (self *RPCClient) SendGRPCNotify(rootCtx context.Context, method string, params []interface{}, opts ...CallOptionFunc) error

func (*RPCClient) SendHTTPNotify

func (self *RPCClient) SendHTTPNotify(rootCtx context.Context, method string, params []interface{}, opts ...CallOptionFunc) error

func (*RPCClient) SendNotify

func (self *RPCClient) SendNotify(rootCtx context.Context, method string, params []interface{}, opts ...CallOptionFunc) error

func (RPCClient) ServerEntry

func (self RPCClient) ServerEntry() ServerEntry

func (RPCClient) String

func (self RPCClient) String() string

func (RPCClient) WebsocketUrlString

func (self RPCClient) WebsocketUrlString() string

type RPCRequest

type RPCRequest struct {
	Message jsonrpc.IMessage
}

type RPCStatusError

type RPCStatusError struct {
	Method string
	Code   int
	Reason string
}

func (RPCStatusError) Error

func (self RPCStatusError) Error() string

type ServerEntry

type ServerEntry struct {
	ServerUrl string // raw url, scheme must be h2 or h2c
	CertFile  string
}

type ServerFlag

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

func NewServerFlag

func NewServerFlag(flagSet *flag.FlagSet) *ServerFlag

misc functions

func (*ServerFlag) Get

func (self *ServerFlag) Get() ServerEntry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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