server

package
v3.2.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0, MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientOption = client.Option{
	Retries:        3,
	RPCPath:        share.DefaultRPCPath,
	ConnectTimeout: 10 * time.Second,
	SerializeType:  protocol.ProtoBuffer,
	CompressType:   protocol.None,
	BackupLatency:  10 * time.Millisecond,
}

Functions

This section is empty.

Types

type MsgpackCodec

type MsgpackCodec struct {
}

func (*MsgpackCodec) Decode

func (c *MsgpackCodec) Decode(data []byte, i interface{}) error

func (*MsgpackCodec) Encode

func (c *MsgpackCodec) Encode(i interface{}) ([]byte, error)

type PBCodec

type PBCodec struct{}

PBCodec uses protobuf marshaler and unmarshaler.

func (PBCodec) Decode

func (c PBCodec) Decode(data []byte, i interface{}) error

Decode decodes an object from slice of bytes.

func (PBCodec) Encode

func (c PBCodec) Encode(i interface{}) ([]byte, error)

Encode encodes an object into slice of bytes.

type RpcClient

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

func NewRpcClient

func NewRpcClient(serverAddress ...string) (*RpcClient, error)

func (*RpcClient) Close

func (this *RpcClient) Close() error

func (*RpcClient) Execute

func (this *RpcClient) Execute(ctx context.Context, servicePath string, args interface{}, reply *vearchpb.PartitionData) (err error)

func (*RpcClient) GetAddress

func (this *RpcClient) GetAddress(i int) string

type RpcServer

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

func NewRpcServer

func NewRpcServer(ip string, port uint16) *RpcServer

func (RpcServer) ActiveClientConn

func (this RpcServer) ActiveClientConn() []net.Conn

func (*RpcServer) AddPlugin

func (this *RpcServer) AddPlugin(plugin server.Plugin)

func (*RpcServer) RegisterHandler

func (this *RpcServer) RegisterHandler(name string, rcvr interface{}, meta string) error

func (*RpcServer) RegisterName

func (this *RpcServer) RegisterName(chain *handler.Chain, meta string) error

func (*RpcServer) Run

func (this *RpcServer) Run() error

func (*RpcServer) SendMessage

func (this *RpcServer) SendMessage(conn net.Conn, servicePath string, data []byte) error

send mesage by bidirectional

func (RpcServer) Stop

func (this RpcServer) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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