rpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgpackClientCodec

func NewMsgpackClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewMsgpackClientCodec :

func NewMsgpackServerCodec

func NewMsgpackServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewMsgpackServerCodec :

Types

type Client

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

Client :

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient :

func (*Client) Call

func (c *Client) Call(method string, args interface{}, reply interface{}) error

Call is used to make an RPC call to the server

type ClientConfig

type ClientConfig struct {
	// Logger
	Logger log.Logger

	// URL of the Drago server (e.g. http://127.0.0.1:8081).
	Address string

	// Timeout when dialing.
	DialTimeout time.Duration
}

func DefaultClientConfig

func DefaultClientConfig() *ClientConfig

func (*ClientConfig) Merge

func (c *ClientConfig) Merge(b *ClientConfig) *ClientConfig

type Server

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

Server :

func NewServer

func NewServer(config *ServerConfig) (*Server, error)

NewServer :

type ServerConfig

type ServerConfig struct {
	//BindAddress
	BindAddress string

	// Logger
	Logger log.Logger

	// Receivers
	Receivers map[string]interface{}
}

func DefaultConfig

func DefaultConfig() *ServerConfig

func (*ServerConfig) Merge

func (s *ServerConfig) Merge(b *ServerConfig) *ServerConfig

Jump to

Keyboard shortcuts

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