binrpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BinRpcMagic        uint = 0xA
	BinRpcVersion      uint = 0x1
	BinRpcMagicVersion uint = BinRpcMagic<<4 + BinRpcVersion

	BinRpcTypeInt    uint = 0x0
	BinRpcTypeString uint = 0x1 // Null-terminated string
	BinRpcTypeDouble uint = 0x2
	BinRpcTypeStruct uint = 0x3
	BinRpcTypeArray  uint = 0x4
	BinRpcTypeAVP    uint = 0x5
	BinRpcTypeBytes  uint = 0x6 // Byte array without null terminator
	BinRpcTypeAll    uint = 0xF // Wildcard; matches any record
)

Variables

This section is empty.

Functions

func ConstructHeader

func ConstructHeader(header *bytes.Buffer, payloadLength uint64, cookie uint32) error

ConstructHeader takes the payload length and cookie and returns a byte array header

func ConstructPayload

func ConstructPayload(payload *bytes.Buffer, valType uint, val interface{}) error

ConstructPayload takes a value and encodes it into a BinRpc payload

func InvokeMethod

func InvokeMethod(method string, host string, port string) error

InvokeMethod calls the given RPC method on the given host and port

func WritePacket

func WritePacket(w io.Writer, valType uint, val interface{}) error

Types

type BinRpcEncoder

type BinRpcEncoder interface {
	Encode(io.Writer) error
}

type BinRpcInt

type BinRpcInt int32

func (BinRpcInt) Encode

func (s BinRpcInt) Encode(w io.Writer) error

type BinRpcString

type BinRpcString string

func (BinRpcString) Encode

func (s BinRpcString) Encode(w io.Writer) error

Jump to

Keyboard shortcuts

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