rpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Call , invoke service method ,like srv.method
	Call(object interface{}, method string, args interface{}) (reply interface{}, err error)
	Close() error
}

func NewClient

func NewClient(addr string, codecType int64) Client

type Codec

type Codec interface {
	ReadHead(interface{}) error
	ReadBody(interface{}) error
	WriteHead(interface{}) error
	WriteBody(interface{}) error
}

type CodecFactory

type CodecFactory interface {
	GetCodec(closer io.ReadWriteCloser) Codec
}

func NewCodecFactory

func NewCodecFactory(codecType int64) CodecFactory
type Head struct {
	ServiceMethod string
	Seq           string
	Error         string
}

type Option

type Option struct {
	CodeType int64
}

Option 用户协商

type Server

type Server interface {
	// Register all exported method of service
	Register(srv interface{})
	Run() error
}

func NewServer

func NewServer(addr string) Server

Jump to

Keyboard shortcuts

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