fastrpc

package module
v0.0.8-beta Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CHUNK_SIZE = 65536
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IOOperator

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

func NewIOOperator

func NewIOOperator(stream *net.TCPConn, readLength uint64) *IOOperator

func (*IOOperator) ReadDataLeft

func (i *IOOperator) ReadDataLeft() uint64

func (*IOOperator) ReadIOStream

func (i *IOOperator) ReadIOStream(count int) ([]byte, error)

func (*IOOperator) WriteError

func (i *IOOperator) WriteError(message string) error

func (*IOOperator) WriteIOFromBuffer

func (i *IOOperator) WriteIOFromBuffer(buf []byte) error

func (*IOOperator) WriteIOFromReader

func (i *IOOperator) WriteIOFromReader(reader io.Reader, count int, chunkSize int) error

func (*IOOperator) WriteNothing

func (i *IOOperator) WriteNothing() error

type MasterCapabilities

type MasterCapabilities struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	IncomingType  string `json:"incomingType"`
	ReturningType string `json:"returningType"`
	// contains filtered or unexported fields
}

type MasterCapabilitiesDTO added in v0.0.7

type MasterCapabilitiesDTO struct {
	RpcID         uint32 `json:"rpcId"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	IncomingType  string `json:"incomingType"`
	ReturningType string `json:"returningType"`
}

type RpcMaster

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

func NewMaster

func NewMaster() (*RpcMaster, error)

func (*RpcMaster) Close added in v0.1.0

func (r *RpcMaster) Close() error

func (*RpcMaster) RegisterRPC

func (r *RpcMaster) RegisterRPC(name string, description string, incomingType string, returningType string,
	rpc func(*IOOperator) error)

func (*RpcMaster) ShowCapabilities

func (r *RpcMaster) ShowCapabilities() ([]MasterCapabilitiesDTO, error)

func (*RpcMaster) Start added in v0.1.0

func (r *RpcMaster) Start(ctx context.Context, ip net.IP, port int) error

type RpcSlave

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

func NewSlave added in v0.1.0

func NewSlave(masterIP net.IP, masterPort int, poolSize int) (*RpcSlave, error)

func (*RpcSlave) CallForBuffer added in v0.1.0

func (r *RpcSlave) CallForBuffer(method string, buf []byte) ([]byte, error)

func (*RpcSlave) DeInitialize

func (r *RpcSlave) DeInitialize()

func (*RpcSlave) GetMasterCapabilities

func (r *RpcSlave) GetMasterCapabilities() ([]MasterCapabilitiesDTO, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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