rpc

package module
v0.0.0-...-9f1f843 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultConnectTimeout = 10 * time.Second // setup a new connection to the server
View Source
const DefaultListenHost = "127.0.0.1"
View Source
const DefaultListenPort = 1234
View Source
const DefaultTimeout = 60 * time.Second // timeout for a connection

Variables

This section is empty.

Functions

This section is empty.

Types

type GobClientCodec

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

func NewGobClientCodec

func NewGobClientCodec(rwc io.ReadWriteCloser) *GobClientCodec

func (*GobClientCodec) Close

func (c *GobClientCodec) Close() error

func (*GobClientCodec) ReadResponseBody

func (c *GobClientCodec) ReadResponseBody(body interface{}) error

func (*GobClientCodec) ReadResponseHeader

func (c *GobClientCodec) ReadResponseHeader(r *rpc.Response) error

func (*GobClientCodec) WriteRequest

func (c *GobClientCodec) WriteRequest(r *rpc.Request, body interface{}) (err error)

type GobServerCodec

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

func NewGobServerCodec

func NewGobServerCodec(rwc io.ReadWriteCloser) *GobServerCodec

func (*GobServerCodec) Close

func (c *GobServerCodec) Close() error

func (*GobServerCodec) ReadRequestBody

func (c *GobServerCodec) ReadRequestBody(body interface{}) error

func (*GobServerCodec) ReadRequestHeader

func (c *GobServerCodec) ReadRequestHeader(r *rpc.Request) error

func (*GobServerCodec) WriteResponse

func (c *GobServerCodec) WriteResponse(r *rpc.Response, body interface{}) (err error)

type OptsConnection

type OptsConnection struct {
	ListenPort     int           `yaml:"listen_port"`
	ListenHost     string        `yaml:"listen_host"`
	AuthToken      string        `yaml:"auth_token"`
	ConnectTimeout time.Duration `yaml:"connection_timeout"`
	Debug          bool          `yaml:"debug"`
}

func NewOptsConnection

func NewOptsConnection() OptsConnection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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