runtime

package
v0.0.0-...-2b23860 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadEnumValue    error = errors.New("Invalid Enum value")
	ErrBadBoolValue    error = errors.New("Invalid Bool value")
	ErrBadLengthPrefix error = errors.New("Invalid encoding - bad length prefix")
)
View Source
var (
	// ErrEmptyUnion indicates a union had no contents (all fields are
	// nil), when exactly one member should be non-nil.
	ErrEmptyUnion          error = errors.New("All fields in the Union are nil")
	ErrMultipleUnionValues error = errors.New("Multiple fields in the Union are non-nil. Exactly one field should be non-nil.")
	ErrBadDate             error = errors.New("Dates before 1st Jan 1970 UTC cannot be encoded")
)
View Source
var (
	RegisterOpcode = registry.RegisterOpcode
)

Functions

func BebopMarshalBoolAt

func BebopMarshalBoolAt(buf []byte, offset int, b bool) (int, error)

func BebopMarshalByteAt

func BebopMarshalByteAt(buf []byte, offset int, bite byte) (int, error)

func BebopMarshalDateAt

func BebopMarshalDateAt(buf []byte, offset int, date time.Time) (int, error)

func BebopMarshalFloat32At

func BebopMarshalFloat32At(buf []byte, offset int, num float32) (int, error)

func BebopMarshalFloat64At

func BebopMarshalFloat64At(buf []byte, offset int, num float64) (int, error)

func BebopMarshalGuidAt

func BebopMarshalGuidAt(buf []byte, offset int, guid uuid.UUID) (int, error)

func BebopMarshalInt16At

func BebopMarshalInt16At(buf []byte, offset int, num int16) (int, error)

func BebopMarshalInt32At

func BebopMarshalInt32At(buf []byte, offset int, num int32) (int, error)

func BebopMarshalInt64At

func BebopMarshalInt64At(buf []byte, offset int, num int64) (int, error)

func BebopMarshalInt8At

func BebopMarshalInt8At(buf []byte, offset int, num int8) (int, error)

func BebopMarshalStringAt

func BebopMarshalStringAt(buf []byte, offset int, str string) (int, error)

func BebopMarshalUint16At

func BebopMarshalUint16At(buf []byte, offset int, num uint16) (int, error)

func BebopMarshalUint32At

func BebopMarshalUint32At(buf []byte, offset int, num uint32) (int, error)

func BebopMarshalUint64At

func BebopMarshalUint64At(buf []byte, offset int, num uint64) (int, error)

func BebopMarshalUint8At

func BebopMarshalUint8At(buf []byte, offset int, num uint8) (int, error)

func BebopUnmarshalBoolAt

func BebopUnmarshalBoolAt(buf []byte, offset int) (bool, int, error)

func BebopUnmarshalByteAt

func BebopUnmarshalByteAt(buf []byte, offset int) (byte, int, error)

func BebopUnmarshalDateAt

func BebopUnmarshalDateAt(buf []byte, offset int) (time.Time, int, error)

func BebopUnmarshalFloat32At

func BebopUnmarshalFloat32At(buf []byte, offset int) (float32, int, error)

func BebopUnmarshalFloat64At

func BebopUnmarshalFloat64At(buf []byte, offset int) (float64, int, error)

func BebopUnmarshalGuidAt

func BebopUnmarshalGuidAt(buf []byte, offset int) (uuid.UUID, int, error)

func BebopUnmarshalInt16At

func BebopUnmarshalInt16At(buf []byte, offset int) (int16, int, error)

func BebopUnmarshalInt32At

func BebopUnmarshalInt32At(buf []byte, offset int) (int32, int, error)

func BebopUnmarshalInt64At

func BebopUnmarshalInt64At(buf []byte, offset int) (int64, int, error)

func BebopUnmarshalInt8At

func BebopUnmarshalInt8At(buf []byte, offset int) (int8, int, error)

func BebopUnmarshalStringAt

func BebopUnmarshalStringAt(buf []byte, offset int) (string, int, error)

func BebopUnmarshalUint16At

func BebopUnmarshalUint16At(buf []byte, offset int) (uint16, int, error)

func BebopUnmarshalUint32At

func BebopUnmarshalUint32At(buf []byte, offset int) (uint32, int, error)

func BebopUnmarshalUint64At

func BebopUnmarshalUint64At(buf []byte, offset int) (uint64, int, error)

func BebopUnmarshalUint8At

func BebopUnmarshalUint8At(buf []byte, offset int) (uint8, int, error)

Types

type Bebop

type Bebop interface {
	// EncodeBebop writes the value to the writer, serialized as Bebop.
	EncodeBebop(writer io.Writer) error

	// DecodeBebop attempts to read Bebop from the reader and to
	// deserialize it into the value.
	DecodeBebop(reader io.Reader) error

	// MarshalBebop writes the value into the buf, serialized as
	// Bebop. The slice of the buf written to is returned. If the buf
	// is too small, a new buf is created, written to, and returned.
	MarshalBebop(buf []byte) ([]byte, error)

	// UnmarshalBebop attempts to read Bebop from the buf and to
	// deserialize it into the value.
	UnmarshalBebop(buf []byte) (int, error)

	// SizeBebop returns the number of bytes this value uses when
	// serialized to Bebop.
	SizeBebop() int
}

Bebop Enums, Structs, Messages and Unions all satisfy this interface.

type Decoder

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

func NewDecoder

func NewDecoder(reader io.Reader) *Decoder

func (*Decoder) DecodeBool

func (self *Decoder) DecodeBool() (bool, int, error)

func (*Decoder) DecodeByte

func (self *Decoder) DecodeByte() (byte, int, error)

func (*Decoder) DecodeDate

func (self *Decoder) DecodeDate() (time.Time, int, error)

func (*Decoder) DecodeFloat32

func (self *Decoder) DecodeFloat32() (float32, int, error)

func (*Decoder) DecodeFloat64

func (self *Decoder) DecodeFloat64() (float64, int, error)

func (*Decoder) DecodeGuid

func (self *Decoder) DecodeGuid() (uuid.UUID, int, error)

func (*Decoder) DecodeInt16

func (self *Decoder) DecodeInt16() (int16, int, error)

func (*Decoder) DecodeInt32

func (self *Decoder) DecodeInt32() (int32, int, error)

func (*Decoder) DecodeInt64

func (self *Decoder) DecodeInt64() (int64, int, error)

func (*Decoder) DecodeInt8

func (self *Decoder) DecodeInt8() (int8, int, error)

func (*Decoder) DecodeString

func (self *Decoder) DecodeString() (string, int, error)

func (*Decoder) DecodeUint16

func (self *Decoder) DecodeUint16() (uint16, int, error)

func (*Decoder) DecodeUint32

func (self *Decoder) DecodeUint32() (uint32, int, error)

func (*Decoder) DecodeUint64

func (self *Decoder) DecodeUint64() (uint64, int, error)

func (*Decoder) DecodeUint8

func (self *Decoder) DecodeUint8() (uint8, int, error)

func (*Decoder) DiscardN

func (self *Decoder) DiscardN(n int) (int, error)

type Encoder

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

func NewEncoder

func NewEncoder(writer io.Writer) *Encoder

func (*Encoder) EncodeBool

func (self *Encoder) EncodeBool(b bool) (err error)

func (*Encoder) EncodeByte

func (self *Encoder) EncodeByte(bite byte) error

func (*Encoder) EncodeDate

func (self *Encoder) EncodeDate(date time.Time) error

func (*Encoder) EncodeFloat32

func (self *Encoder) EncodeFloat32(num float32) (err error)

func (*Encoder) EncodeFloat64

func (self *Encoder) EncodeFloat64(num float64) (err error)

func (*Encoder) EncodeGuid

func (self *Encoder) EncodeGuid(guid uuid.UUID) (err error)

func (*Encoder) EncodeInt16

func (self *Encoder) EncodeInt16(num int16) error

func (*Encoder) EncodeInt32

func (self *Encoder) EncodeInt32(num int32) error

func (*Encoder) EncodeInt64

func (self *Encoder) EncodeInt64(num int64) error

func (*Encoder) EncodeInt8

func (self *Encoder) EncodeInt8(num int8) error

func (*Encoder) EncodeString

func (self *Encoder) EncodeString(str string) (err error)

func (*Encoder) EncodeUint16

func (self *Encoder) EncodeUint16(num uint16) (err error)

func (*Encoder) EncodeUint32

func (self *Encoder) EncodeUint32(num uint32) (err error)

func (*Encoder) EncodeUint64

func (self *Encoder) EncodeUint64(num uint64) (err error)

func (*Encoder) EncodeUint8

func (self *Encoder) EncodeUint8(num uint8) (err error)

type OpcodeRegistry

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

func NewOpcodeRegistry

func NewOpcodeRegistry() *OpcodeRegistry

func (*OpcodeRegistry) RegisterOpcode

func (self *OpcodeRegistry) RegisterOpcode(name string, opcode uint32)

Jump to

Keyboard shortcuts

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