types

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: AGPL-3.0 Imports: 9 Imported by: 79

Documentation

Overview

Package types provides types used in Quazal Rendez-Vous/NEX

Index

Constants

This section is empty.

Variables

View Source
var AnyObjectHolderObjects = make(map[RVType]HoldableObject)

AnyObjectHolderObjects holds a mapping of RVTypes that are accessible in a AnyDataHolder

View Source
var VariantTypes = make(map[UInt8]RVType)

VariantTypes holds a mapping of RVTypes that are accessible in a Variant

Functions

func RegisterObjectHolderType added in v2.1.0

func RegisterObjectHolderType(rvType HoldableObject)

RegisterObjectHolderType registers a RVType to be accessible in a AnyDataHolder

func RegisterVariantType

func RegisterVariantType(id UInt8, rvType RVType)

RegisterVariantType registers a RVType to be accessible in a Variant

Types

type AnyObjectHolder added in v2.1.0

type AnyObjectHolder[T HoldableObject] struct {
	Object T
}

AnyObjectHolder can hold a reference to any RVType which can be held

func NewAnyObjectHolder added in v2.1.0

func NewAnyObjectHolder[T HoldableObject]() AnyObjectHolder[T]

NewAnyObjectHolder returns a new AnyObjectHolder

func (AnyObjectHolder[T]) Copy added in v2.1.0

func (aoh AnyObjectHolder[T]) Copy() RVType

Copy returns a new copied instance of AnyObjectHolder

func (AnyObjectHolder[T]) CopyRef added in v2.1.0

func (aoh AnyObjectHolder[T]) CopyRef() RVTypePtr

CopyRef copies the current value of the AnyObjectHolder and returns a pointer to the new copy

func (*AnyObjectHolder[T]) Deref added in v2.1.0

func (aoh *AnyObjectHolder[T]) Deref() RVType

Deref takes a pointer to the AnyObjectHolder and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (AnyObjectHolder[T]) Equals added in v2.1.0

func (aoh AnyObjectHolder[T]) Equals(o RVType) bool

Equals checks if the passed Structure contains the same data as the current instance

func (*AnyObjectHolder[T]) ExtractFrom added in v2.1.0

func (aoh *AnyObjectHolder[T]) ExtractFrom(readable Readable) error

ExtractFrom extracts the AnyObjectHolder from the given readable

func (AnyObjectHolder[T]) FormatToString added in v2.1.0

func (aoh AnyObjectHolder[T]) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (AnyObjectHolder[T]) String added in v2.1.0

func (aoh AnyObjectHolder[T]) String() string

String returns a string representation of the struct

func (AnyObjectHolder[T]) WriteTo added in v2.1.0

func (aoh AnyObjectHolder[T]) WriteTo(writable Writable)

WriteTo writes the AnyObjectHolder to the given writable

type Bool added in v2.1.0

type Bool bool

Bool is a type alias for the Go basic type bool for use as an RVType

func NewBool added in v2.1.0

func NewBool(input bool) Bool

NewBool returns a new Bool

func (Bool) Copy added in v2.1.0

func (b Bool) Copy() RVType

Copy returns a pointer to a copy of the Bool. Requires type assertion when used

func (Bool) CopyRef added in v2.1.0

func (b Bool) CopyRef() RVTypePtr

CopyRef copies the current value of the Bool and returns a pointer to the new copy

func (*Bool) Deref added in v2.1.0

func (b *Bool) Deref() RVType

Deref takes a pointer to the Bool and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Bool) Equals added in v2.1.0

func (b Bool) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Bool) ExtractFrom added in v2.1.0

func (b *Bool) ExtractFrom(readable Readable) error

ExtractFrom extracts the Bool value from the given readable

func (Bool) String added in v2.1.0

func (b Bool) String() string

String returns a string representation of the Bool

func (Bool) WriteTo added in v2.1.0

func (b Bool) WriteTo(writable Writable)

WriteTo writes the Bool to the given writable

type Buffer

type Buffer []byte

Buffer is an implementation of rdv::Buffer. Type alias of []byte. Same as QBuffer but with a uint32 length field.

func NewBuffer

func NewBuffer(input []byte) Buffer

NewBuffer returns a new Buffer

func (Buffer) Copy

func (b Buffer) Copy() RVType

Copy returns a pointer to a copy of the Buffer. Requires type assertion when used

func (Buffer) CopyRef added in v2.1.0

func (b Buffer) CopyRef() RVTypePtr

CopyRef copies the current value of the Buffer and returns a pointer to the new copy

func (*Buffer) Deref added in v2.1.0

func (b *Buffer) Deref() RVType

Deref takes a pointer to the Buffer and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Buffer) Equals

func (b Buffer) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Buffer) ExtractFrom

func (b *Buffer) ExtractFrom(readable Readable) error

ExtractFrom extracts the Buffer from the given readable

func (Buffer) String

func (b Buffer) String() string

String returns a string representation of the struct

func (Buffer) WriteTo

func (b Buffer) WriteTo(writable Writable)

WriteTo writes the Buffer to the given writable

type ClassVersionContainer

type ClassVersionContainer struct {
	Structure
	ClassVersions Map[String, UInt16] `json:"class_versions" db:"class_versions" bson:"class_versions" xml:"ClassVersions"`
}

ClassVersionContainer is an implementation of rdv::ClassVersionContainer. Contains version info for Structures used in verbose RMC messages.

func NewClassVersionContainer

func NewClassVersionContainer() ClassVersionContainer

NewClassVersionContainer returns a new ClassVersionContainer

func (ClassVersionContainer) Copy

func (cvc ClassVersionContainer) Copy() RVType

Copy returns a pointer to a copy of the ClassVersionContainer. Requires type assertion when used

func (ClassVersionContainer) CopyRef added in v2.1.0

func (cvc ClassVersionContainer) CopyRef() RVTypePtr

CopyRef copies the current value of the ClassVersionContainer and returns a pointer to the new copy

func (*ClassVersionContainer) Deref added in v2.1.0

func (cvc *ClassVersionContainer) Deref() RVType

Deref takes a pointer to the ClassVersionContainer and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (ClassVersionContainer) Equals

func (cvc ClassVersionContainer) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*ClassVersionContainer) ExtractFrom

func (cvc *ClassVersionContainer) ExtractFrom(readable Readable) error

ExtractFrom extracts the ClassVersionContainer from the given readable

func (ClassVersionContainer) FormatToString

func (cvc ClassVersionContainer) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (ClassVersionContainer) String

func (cvc ClassVersionContainer) String() string

String returns a string representation of the struct

func (ClassVersionContainer) WriteTo

func (cvc ClassVersionContainer) WriteTo(writable Writable)

WriteTo writes the ClassVersionContainer to the given writable

type Data

type Data struct {
	Structure
}

Data is an implementation of rdv::Data. This structure has no data, and instead acts as the base class for many other structures.

func NewData

func NewData() Data

NewData returns a new Data Structure

func (Data) Copy

func (d Data) Copy() RVType

Copy returns a pointer to a copy of the Data. Requires type assertion when used

func (Data) CopyRef added in v2.1.0

func (d Data) CopyRef() RVTypePtr

CopyRef copies the current value of the Data and returns a pointer to the new copy

func (Data) DataObjectID added in v2.1.0

func (d Data) DataObjectID() RVType

DataObjectID returns the object identifier of the type embedding Data

func (*Data) Deref added in v2.1.0

func (d *Data) Deref() RVType

Deref takes a pointer to the Data and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Data) Equals

func (d Data) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Data) ExtractFrom

func (d *Data) ExtractFrom(readable Readable) error

ExtractFrom extracts the Data from the given readable

func (Data) FormatToString

func (d Data) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (Data) ObjectID added in v2.1.0

func (d Data) ObjectID() RVType

ObjectID returns the object identifier of the type

func (Data) String

func (d Data) String() string

String returns a string representation of the struct

func (Data) WriteTo

func (d Data) WriteTo(writable Writable)

WriteTo writes the Data to the given writable

type DataHolder added in v2.1.0

type DataHolder = AnyObjectHolder[DataInterface]

DataHolder is an AnyObjectHolder for types which embed Data

func NewDataHolder added in v2.1.0

func NewDataHolder() DataHolder

NewDataHolder returns a new DataHolder

type DataInterface added in v2.1.0

type DataInterface interface {
	HoldableObject
	DataObjectID() RVType // Returns the object identifier of the type embedding Data
}

DataInterface defines an interface to track types which have Data anywhere in their parent tree.

type DateTime

type DateTime uint64

DateTime is an implementation of rdv::DateTime. Type alias of uint64. The underlying value is a uint64 bit field containing date and time information.

func NewDateTime

func NewDateTime(input uint64) DateTime

NewDateTime returns a new DateTime instance

func (DateTime) Copy

func (dt DateTime) Copy() RVType

Copy returns a new copied instance of DateTime

func (DateTime) CopyRef added in v2.1.0

func (dt DateTime) CopyRef() RVTypePtr

CopyRef copies the current value of the DateTime and returns a pointer to the new copy

func (DateTime) Day

func (dt DateTime) Day() int

Day returns the day value stored in the DateTime

func (*DateTime) Deref added in v2.1.0

func (dt *DateTime) Deref() RVType

Deref takes a pointer to the DateTime and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (DateTime) Equals

func (dt DateTime) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*DateTime) ExtractFrom

func (dt *DateTime) ExtractFrom(readable Readable) error

ExtractFrom extracts the DateTime from the given readable

func (DateTime) FormatToString

func (dt DateTime) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (DateTime) FromTimestamp

func (dt DateTime) FromTimestamp(timestamp time.Time) DateTime

FromTimestamp converts a Time timestamp into a NEX DateTime

func (DateTime) Hour

func (dt DateTime) Hour() int

Hour returns the hours value stored in the DateTime

func (*DateTime) Make

func (dt *DateTime) Make(year, month, day, hour, minute, second int) DateTime

Make initilizes a DateTime with the input data

func (DateTime) Minute

func (dt DateTime) Minute() int

Minute returns the minutes value stored in the DateTime

func (DateTime) Month

func (dt DateTime) Month() time.Month

Month returns the month value stored in the DateTime

func (DateTime) Now

func (dt DateTime) Now() DateTime

Now returns a NEX DateTime value of the current UTC time

func (DateTime) Second

func (dt DateTime) Second() int

Second returns the seconds value stored in the DateTime

func (DateTime) Standard

func (dt DateTime) Standard() time.Time

Standard returns the DateTime as a standard time.Time

func (DateTime) String

func (dt DateTime) String() string

String returns a string representation of the struct

func (DateTime) WriteTo

func (dt DateTime) WriteTo(writable Writable)

WriteTo writes the DateTime to the given writable

func (DateTime) Year

func (dt DateTime) Year() int

Year returns the year value stored in the DateTime

type Double added in v2.1.0

type Double float64

Double is a type alias for the Go basic type float64 for use as an RVType

func NewDouble added in v2.1.0

func NewDouble(input float64) Double

NewDouble returns a new Double

func (Double) Copy added in v2.1.0

func (d Double) Copy() RVType

Copy returns a pointer to a copy of the Double. Requires type assertion when used

func (Double) CopyRef added in v2.1.0

func (d Double) CopyRef() RVTypePtr

CopyRef copies the current value of the Double and returns a pointer to the new copy

func (*Double) Deref added in v2.1.0

func (d *Double) Deref() RVType

Deref takes a pointer to the Double and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Double) Equals added in v2.1.0

func (d Double) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Double) ExtractFrom added in v2.1.0

func (d *Double) ExtractFrom(readable Readable) error

ExtractFrom extracts the Double value from the given readable

func (Double) String added in v2.1.0

func (d Double) String() string

String returns a string representation of the Double

func (Double) WriteTo added in v2.1.0

func (d Double) WriteTo(writable Writable)

WriteTo writes the Double to the given writable

type Float added in v2.1.0

type Float float32

Float is a type alias for the Go basic type float32 for use as an RVType

func NewFloat added in v2.1.0

func NewFloat(input float32) Float

NewFloat returns a new Float

func (Float) Copy added in v2.1.0

func (f Float) Copy() RVType

Copy returns a pointer to a copy of the Float. Requires type assertion when used

func (Float) CopyRef added in v2.1.0

func (f Float) CopyRef() RVTypePtr

CopyRef copies the current value of the Float and returns a pointer to the new copy

func (*Float) Deref added in v2.1.0

func (f *Float) Deref() RVType

Deref takes a pointer to the Float and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Float) Equals added in v2.1.0

func (f Float) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Float) ExtractFrom added in v2.1.0

func (f *Float) ExtractFrom(readable Readable) error

ExtractFrom extracts the Float value from the given readable

func (Float) String added in v2.1.0

func (f Float) String() string

String returns a string representation of the Float

func (Float) WriteTo added in v2.1.0

func (f Float) WriteTo(writable Writable)

WriteTo writes the Float to the given writable

type HoldableObject added in v2.1.0

type HoldableObject interface {
	RVType
	ObjectID() RVType // Returns the object identifier of the type
}

HoldableObject defines a common interface for types which can be placed in AnyObjectHolder

type Int16 added in v2.1.0

type Int16 int16

Int16 is a type alias for the Go basic type int16 for use as an RVType

func NewInt16 added in v2.1.0

func NewInt16(input int16) Int16

NewInt16 returns a new Int16

func (Int16) Copy added in v2.1.0

func (i16 Int16) Copy() RVType

Copy returns a pointer to a copy of the Int16. Requires type assertion when used

func (Int16) CopyRef added in v2.1.0

func (i16 Int16) CopyRef() RVTypePtr

CopyRef copies the current value of the Int16 and returns a pointer to the new copy

func (*Int16) Deref added in v2.1.0

func (i16 *Int16) Deref() RVType

Deref takes a pointer to the Int16 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Int16) Equals added in v2.1.0

func (i16 Int16) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Int16) ExtractFrom added in v2.1.0

func (i16 *Int16) ExtractFrom(readable Readable) error

ExtractFrom extracts the Int16 value from the given readable

func (Int16) String added in v2.1.0

func (i16 Int16) String() string

String returns a string representation of the Int16

func (Int16) WriteTo added in v2.1.0

func (i16 Int16) WriteTo(writable Writable)

WriteTo writes the Int16 to the given writable

type Int32 added in v2.1.0

type Int32 int32

Int32 is a type alias for the Go basic type int32 for use as an RVType

func NewInt32 added in v2.1.0

func NewInt32(input int32) Int32

NewInt32 returns a new Int32

func (Int32) Copy added in v2.1.0

func (i32 Int32) Copy() RVType

Copy returns a pointer to a copy of the Int32. Requires type assertion when used

func (Int32) CopyRef added in v2.1.0

func (i32 Int32) CopyRef() RVTypePtr

CopyRef copies the current value of the Int32 and returns a pointer to the new copy

func (*Int32) Deref added in v2.1.0

func (i32 *Int32) Deref() RVType

Deref takes a pointer to the Int32 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Int32) Equals added in v2.1.0

func (i32 Int32) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Int32) ExtractFrom added in v2.1.0

func (i32 *Int32) ExtractFrom(readable Readable) error

ExtractFrom extracts the Int32 value from the given readable

func (Int32) String added in v2.1.0

func (i32 Int32) String() string

String returns a string representation of the Int32

func (Int32) WriteTo added in v2.1.0

func (i32 Int32) WriteTo(writable Writable)

WriteTo writes the Int32 to the given writable

type Int64 added in v2.1.0

type Int64 int64

Int64 is a type alias for the Go basic type int64 for use as an RVType

func NewInt64 added in v2.1.0

func NewInt64(input int64) Int64

NewInt64 returns a new Int64

func (Int64) Copy added in v2.1.0

func (i64 Int64) Copy() RVType

Copy returns a pointer to a copy of the Int64. Requires type assertion when used

func (Int64) CopyRef added in v2.1.0

func (i64 Int64) CopyRef() RVTypePtr

CopyRef copies the current value of the Int64 and returns a pointer to the new copy

func (*Int64) Deref added in v2.1.0

func (i64 *Int64) Deref() RVType

Deref takes a pointer to the Int64 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Int64) Equals added in v2.1.0

func (i64 Int64) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Int64) ExtractFrom added in v2.1.0

func (i64 *Int64) ExtractFrom(readable Readable) error

ExtractFrom extracts the Int64 value from the given readable

func (Int64) String added in v2.1.0

func (i64 Int64) String() string

String returns a string representation of the Int64

func (Int64) WriteTo added in v2.1.0

func (i64 Int64) WriteTo(writable Writable)

WriteTo writes the Int64 to the given writable

type Int8 added in v2.1.0

type Int8 int8

Int8 is a type alias for the Go basic type int8 for use as an RVType

func NewInt8 added in v2.1.0

func NewInt8(input int8) Int8

NewInt8 returns a new Int8

func (Int8) Copy added in v2.1.0

func (i8 Int8) Copy() RVType

Copy returns a pointer to a copy of the Int8. Requires type assertion when used

func (Int8) CopyRef added in v2.1.0

func (i8 Int8) CopyRef() RVTypePtr

CopyRef copies the current value of the Int8 and returns a pointer to the new copy

func (*Int8) Deref added in v2.1.0

func (i8 *Int8) Deref() RVType

Deref takes a pointer to the Int8 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Int8) Equals added in v2.1.0

func (i8 Int8) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Int8) ExtractFrom added in v2.1.0

func (i8 *Int8) ExtractFrom(readable Readable) error

ExtractFrom extracts the Int8 value from the given readable

func (Int8) String added in v2.1.0

func (i8 Int8) String() string

String returns a string representation of the Int8

func (Int8) WriteTo added in v2.1.0

func (i8 Int8) WriteTo(writable Writable)

WriteTo writes the Int8 to the given writable

type List

type List[T RVType] []T

List is an implementation of rdv::qList. This data type holds an array of other types.

Unlike Buffer and qBuffer, which use the same data type with differing size field lengths, there does not seem to be an official rdv::List type

func NewList

func NewList[T RVType]() List[T]

NewList returns a new List of the provided type

func (List[T]) Contains

func (l List[T]) Contains(checkValue T) bool

Contains checks if the provided value exists in the List

func (List[T]) Copy

func (l List[T]) Copy() RVType

Copy returns a pointer to a copy of the List. Requires type assertion when used

func (List[T]) CopyRef added in v2.1.0

func (l List[T]) CopyRef() RVTypePtr

CopyRef copies the current value of the List and returns a pointer to the new copy

func (*List[T]) Deref added in v2.1.0

func (l *List[T]) Deref() RVType

Deref takes a pointer to the List and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (List[T]) Equals

func (l List[T]) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*List[T]) ExtractFrom

func (l *List[T]) ExtractFrom(readable Readable) error

ExtractFrom extracts the List from the given readable

func (List[T]) String

func (l List[T]) String() string

String returns a string representation of the struct

func (List[T]) WriteTo

func (l List[T]) WriteTo(writable Writable)

WriteTo writes the List to the given writable

type Map

type Map[K comparable, V RVType] map[K]V

Map represents a Quazal Rendez-Vous/NEX Map type. Type alias of map[K]V. There is not an official type in either the rdv or nn::nex namespaces. May have any RVType as both a key and value. If either they key or value types are not an RVType, they are ignored.

Incompatible with RVType pointers!

func NewMap

func NewMap[K comparable, V RVType]() Map[K, V]

NewMap returns a new Map of the provided type

func (Map[K, V]) Copy

func (m Map[K, V]) Copy() RVType

Copy returns a pointer to a copy of the Map. Requires type assertion when used

func (Map[K, V]) CopyRef added in v2.1.0

func (m Map[K, V]) CopyRef() RVTypePtr

CopyRef copies the current value of the Map and returns a pointer to the new copy

func (*Map[K, V]) Deref added in v2.1.0

func (m *Map[K, V]) Deref() RVType

Deref takes a pointer to the Map and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Map[K, V]) Equals

func (m Map[K, V]) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Map[K, V]) ExtractFrom

func (m *Map[K, V]) ExtractFrom(readable Readable) error

ExtractFrom extracts the Map from the given readable

func (Map[K, V]) FormatToString

func (m Map[K, V]) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (Map[K, V]) String

func (m Map[K, V]) String() string

String returns a string representation of the struct

func (Map[K, V]) WriteTo

func (m Map[K, V]) WriteTo(writable Writable)

WriteTo writes the Map to the given writable

type PID

type PID uint64

PID represents a unique number to identify a user. Type alias of uint64. The true size of this value depends on the client version. Legacy clients (Wii U/3DS) use a uint32, whereas modern clients (Nintendo Switch) use a uint64.

func NewPID

func NewPID(input uint64) PID

NewPID returns a PID instance. The real size of PID depends on the client version

func (PID) Copy

func (p PID) Copy() RVType

Copy returns a pointer to a copy of the PID. Requires type assertion when used

func (PID) CopyRef added in v2.1.0

func (p PID) CopyRef() RVTypePtr

CopyRef copies the current value of the PID and returns a pointer to the new copy

func (*PID) Deref added in v2.1.0

func (p *PID) Deref() RVType

Deref takes a pointer to the PID and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (PID) Equals

func (p PID) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*PID) ExtractFrom

func (p *PID) ExtractFrom(readable Readable) error

ExtractFrom extracts the PID from the given readable

func (PID) FormatToString

func (p PID) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (PID) String

func (p PID) String() string

String returns a string representation of the struct

func (PID) WriteTo

func (p PID) WriteTo(writable Writable)

WriteTo writes the PID to the given writable

type QBuffer

type QBuffer []byte

QBuffer is an implementation of rdv::qBuffer. Type alias of []byte. Same as Buffer but with a uint16 length field.

func NewQBuffer

func NewQBuffer(input []byte) QBuffer

NewQBuffer returns a new QBuffer

func (QBuffer) Copy

func (qb QBuffer) Copy() RVType

Copy returns a pointer to a copy of the qBuffer. Requires type assertion when used

func (QBuffer) CopyRef added in v2.1.0

func (qb QBuffer) CopyRef() RVTypePtr

CopyRef copies the current value of the QBuffer and returns a pointer to the new copy

func (*QBuffer) Deref added in v2.1.0

func (qb *QBuffer) Deref() RVType

Deref takes a pointer to the QBuffer and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (QBuffer) Equals

func (qb QBuffer) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*QBuffer) ExtractFrom

func (qb *QBuffer) ExtractFrom(readable Readable) error

ExtractFrom extracts the QBuffer from the given readable

func (QBuffer) String

func (qb QBuffer) String() string

String returns a string representation of the struct

func (QBuffer) WriteTo

func (qb QBuffer) WriteTo(writable Writable)

WriteTo writes the []byte to the given writable

type QResult

type QResult uint32

QResult is an implementation of rdv::qResult. Type alias of uint32. Determines the result of an operation. If the MSB is set the result is an error, otherwise success

func NewQResult

func NewQResult(input uint32) QResult

NewQResult returns a new QResult

func NewQResultError

func NewQResultError(code uint32) QResult

NewQResultError returns a new QResult set as an error

func NewQResultSuccess

func NewQResultSuccess(code uint32) QResult

NewQResultSuccess returns a new QResult set as a success

func (QResult) Copy

func (r QResult) Copy() RVType

Copy returns a pointer to a copy of the QResult. Requires type assertion when used

func (QResult) CopyRef added in v2.1.0

func (r QResult) CopyRef() RVTypePtr

CopyRef copies the current value of the QResult and returns a pointer to the new copy

func (*QResult) Deref added in v2.1.0

func (r *QResult) Deref() RVType

Deref takes a pointer to the QResult and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (QResult) Equals

func (r QResult) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*QResult) ExtractFrom

func (r *QResult) ExtractFrom(readable Readable) error

ExtractFrom extracts the QResult from the given readable

func (QResult) FormatToString

func (r QResult) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (QResult) IsError

func (r QResult) IsError() bool

IsError returns true if the QResult is a error

func (QResult) IsSuccess

func (r QResult) IsSuccess() bool

IsSuccess returns true if the QResult is a success

func (QResult) String

func (r QResult) String() string

String returns a string representation of the struct

func (QResult) WriteTo

func (r QResult) WriteTo(writable Writable)

WriteTo writes the QResult to the given writable

type QUUID

type QUUID []byte

QUUID is an implementation of rdv::qUUID. Type alias of []byte. Encodes a UUID in little-endian byte order.

func NewQUUID

func NewQUUID(input []byte) QUUID

NewQUUID returns a new qUUID

func (QUUID) Copy

func (qu QUUID) Copy() RVType

Copy returns a new copied instance of qUUID

func (QUUID) CopyRef added in v2.1.0

func (qu QUUID) CopyRef() RVTypePtr

CopyRef copies the current value of the QUUID and returns a pointer to the new copy

func (*QUUID) Deref added in v2.1.0

func (qu *QUUID) Deref() RVType

Deref takes a pointer to the QUUID and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (QUUID) Equals

func (qu QUUID) Equals(o RVType) bool

Equals checks if the passed Structure contains the same data as the current instance

func (*QUUID) ExtractFrom

func (qu *QUUID) ExtractFrom(readable Readable) error

ExtractFrom extracts the QUUID from the given readable

func (QUUID) FormatToString

func (qu QUUID) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (*QUUID) FromString

func (qu *QUUID) FromString(uuid string) error

FromString converts a UUID string to a qUUID

func (QUUID) GetStringValue

func (qu QUUID) GetStringValue() string

GetStringValue returns the UUID encoded in the qUUID

func (QUUID) String

func (qu QUUID) String() string

String returns a string representation of the struct

func (QUUID) WriteTo

func (qu QUUID) WriteTo(writable Writable)

WriteTo writes the QUUID to the given writable

type RVConnectionData

type RVConnectionData struct {
	Structure
	StationURL                 StationURL  `json:"station_url" db:"station_url" bson:"station_url" xml:"StationURL"`
	SpecialProtocols           List[UInt8] `json:"special_protocols" db:"special_protocols" bson:"special_protocols" xml:"SpecialProtocols"`
	StationURLSpecialProtocols StationURL  `` /* 141-byte string literal not displayed */
	Time                       DateTime    `json:"time" db:"time" bson:"time" xml:"Time"`
}

RVConnectionData is an implementation of rdv::RVConnectionData. Contains the locations and data of Rendez-Vous connection.

func NewRVConnectionData

func NewRVConnectionData() RVConnectionData

NewRVConnectionData returns a new RVConnectionData

func (RVConnectionData) Copy

func (rvcd RVConnectionData) Copy() RVType

Copy returns a new copied instance of RVConnectionData

func (RVConnectionData) CopyRef added in v2.1.0

func (rvcd RVConnectionData) CopyRef() RVTypePtr

CopyRef copies the current value of the RVConnectionData and returns a pointer to the new copy

func (*RVConnectionData) Deref added in v2.1.0

func (rvcd *RVConnectionData) Deref() RVType

Deref takes a pointer to the RVConnectionData and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (RVConnectionData) Equals

func (rvcd RVConnectionData) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*RVConnectionData) ExtractFrom

func (rvcd *RVConnectionData) ExtractFrom(readable Readable) error

ExtractFrom extracts the RVConnectionData from the given readable

func (RVConnectionData) FormatToString

func (rvcd RVConnectionData) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (RVConnectionData) String

func (rvcd RVConnectionData) String() string

String returns a string representation of the struct

func (RVConnectionData) WriteTo

func (rvcd RVConnectionData) WriteTo(writable Writable)

WriteTo writes the RVConnectionData to the given writable

type RVType

type RVType interface {
	WriteTo(writable Writable) // Writes the type data to the given Writable stream
	Copy() RVType              // Returns a non-pointer copy of the type data. Complex types are deeply copied
	CopyRef() RVTypePtr        // Returns a pointer to a copy of the type data. Complex types are deeply copied. Useful for obtaining a pointer without reflection, though limited to copies
	Equals(other RVType) bool  // Checks if the input type is strictly equal to the current type
}

RVType represents a Quazal Rendez-Vous/NEX type. This includes primitives and custom types.

type RVTypePtr added in v2.1.0

type RVTypePtr interface {
	RVType
	ExtractFrom(readable Readable) error // Reads the type data to the given Readable stream
	Deref() RVType                       // Returns the raw type data from a pointer. Useful for ensuring you have raw data without reflection
}

RVTypePtr represents a pointer to an RVType. Used to separate pointer receivers for easier type checking.

type Readable

type Readable interface {
	StringLengthSize() int              // Returns the size of the length field for rdv::String types. Only 2 and 4 are valid
	PIDSize() int                       // Returns the size of the length fields for nn::nex::PID types. Only 4 and 8 are valid
	UseStructureHeader() bool           // Returns whether or not Structure types should use a header
	Remaining() uint64                  // Returns the number of bytes left unread in the buffer
	ReadRemaining() []byte              // Reads the remaining data from the buffer
	Read(length uint64) ([]byte, error) // Reads up to length bytes of data from the buffer. Returns an error if the read failed, such as if there was not enough data to read
	ReadUInt8() (uint8, error)          // Reads a primitive Go uint8. Returns an error if the read failed, such as if there was not enough data to read
	ReadUInt16LE() (uint16, error)      // Reads a primitive Go uint16. Returns an error if the read failed, such as if there was not enough data to read
	ReadUInt32LE() (uint32, error)      // Reads a primitive Go uint32. Returns an error if the read failed, such as if there was not enough data to read
	ReadUInt64LE() (uint64, error)      // Reads a primitive Go uint64. Returns an error if the read failed, such as if there was not enough data to read
	ReadInt8() (int8, error)            // Reads a primitive Go int8. Returns an error if the read failed, such as if there was not enough data to read
	ReadInt16LE() (int16, error)        // Reads a primitive Go int16. Returns an error if the read failed, such as if there was not enough data to read
	ReadInt32LE() (int32, error)        // Reads a primitive Go int32. Returns an error if the read failed, such as if there was not enough data to read
	ReadInt64LE() (int64, error)        // Reads a primitive Go int64. Returns an error if the read failed, such as if there was not enough data to read
	ReadFloat32LE() (float32, error)    // Reads a primitive Go float32. Returns an error if the read failed, such as if there was not enough data to read
	ReadFloat64LE() (float64, error)    // Reads a primitive Go float64. Returns an error if the read failed, such as if there was not enough data to read
	ReadBool() (bool, error)            // Reads a primitive Go bool. Returns an error if the read failed, such as if there was not enough data to read
}

Readable represents a struct that types can read from

type ResultRange

type ResultRange struct {
	Structure
	Offset UInt32 `json:"offset" db:"offset" bson:"offset" xml:"Offset"` // * Offset into the dataset
	Length UInt32 `json:"length" db:"length" bson:"length" xml:"Length"` // * Number of items to return
}

ResultRange is an implementation of rdv::ResultRange. Holds information about how to make queries which may return large data.

func NewResultRange

func NewResultRange() ResultRange

NewResultRange returns a new ResultRange

func (ResultRange) Copy

func (rr ResultRange) Copy() RVType

Copy returns a new copied instance of ResultRange

func (ResultRange) CopyRef added in v2.1.0

func (rr ResultRange) CopyRef() RVTypePtr

CopyRef copies the current value of the ResultRange and returns a pointer to the new copy

func (*ResultRange) Deref added in v2.1.0

func (rr *ResultRange) Deref() RVType

Deref takes a pointer to the ResultRange and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (ResultRange) Equals

func (rr ResultRange) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*ResultRange) ExtractFrom

func (rr *ResultRange) ExtractFrom(readable Readable) error

ExtractFrom extracts the ResultRange from the given readable

func (ResultRange) FormatToString

func (rr ResultRange) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (ResultRange) String

func (rr ResultRange) String() string

String returns a string representation of the struct

func (ResultRange) WriteTo

func (rr ResultRange) WriteTo(writable Writable)

WriteTo writes the ResultRange to the given writable

type StationURL

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

StationURL is an implementation of rdv::StationURL.

Contains location of a station to connect to, with data about how to connect.

func NewStationURL

func NewStationURL(url String) StationURL

NewStationURL returns a new StationURL

func (StationURL) Address

func (s StationURL) Address() (string, bool)

Address gets the stations IP address.

Originally called nn::nex::StationURL::GetAddress

func (StationURL) ConnectionID

func (s StationURL) ConnectionID() (uint32, bool)

ConnectionID gets the stations connection ID.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetConnectionID

func (StationURL) Copy

func (s StationURL) Copy() RVType

Copy returns a new copied instance of StationURL

func (StationURL) CopyRef added in v2.1.0

func (s StationURL) CopyRef() RVTypePtr

CopyRef copies the current value of the StationURL and returns a pointer to the new copy

func (*StationURL) Deref added in v2.1.0

func (s *StationURL) Deref() RVType

Deref takes a pointer to the StationURL and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (StationURL) Equals

func (s StationURL) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*StationURL) ExtractFrom

func (s *StationURL) ExtractFrom(readable Readable) error

ExtractFrom extracts the StationURL from the given readable

func (*StationURL) Format added in v2.1.0

func (s *StationURL) Format()

Format encodes the StationURL into a string

func (StationURL) FormatToString

func (s StationURL) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (*StationURL) Get added in v2.1.0

func (s *StationURL) Get(name string, custom bool) (string, bool)

Get returns the value of the requested param.

Returns the string value and a bool indicating if the value existed or not.

"custom" determines whether or not the parameter is a standard parameter or an application-specific parameter

func (StationURL) IsBehindNAT

func (s StationURL) IsBehindNAT() bool

IsBehindNAT checks if the user is behind NAT

func (StationURL) IsFastProbeResponseEnabled

func (s StationURL) IsFastProbeResponseEnabled() bool

IsFastProbeResponseEnabled checks if fast probe response is enabled

Originally called nn::nex::StationURL::GetFastProbeResponse

func (StationURL) IsNATPMPSupported

func (s StationURL) IsNATPMPSupported() bool

IsNATPMPSupported checks whether PMP is enabled on the station.

Originally called nn::nex::StationURL::GetNatPMPSupport

func (StationURL) IsProbeRequestInitiationEnabled

func (s StationURL) IsProbeRequestInitiationEnabled() bool

IsProbeRequestInitiationEnabled checks wheteher probing should be initiated.

Originally called nn::nex::StationURL::GetProbeRequestInitiation

func (StationURL) IsPublic

func (s StationURL) IsPublic() bool

IsPublic checks if the station is a public address

func (StationURL) IsRelayServerEnabled

func (s StationURL) IsRelayServerEnabled() bool

IsRelayServerEnabled checks whether the connection should use a relay server.

Originally called nn::nex::StationURL::GetUseRelayServer

func (StationURL) IsUPnPSupported

func (s StationURL) IsUPnPSupported() bool

IsUPnPSupported checks whether UPnP is enabled on the station.

Originally called nn::nex::StationURL::GetUPnPSupport

func (StationURL) NATFiltering

func (s StationURL) NATFiltering() (constants.NATFilteringProperties, bool)

NATFiltering gets the clients NAT filtering properties.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetNATFiltering

func (StationURL) NATMapping

func (s StationURL) NATMapping() (constants.NATMappingProperties, bool)

NATMapping gets the clients NAT mapping properties.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetNATMapping

func (StationURL) NodeID

func (s StationURL) NodeID() (uint16, bool)

NodeID gets the stations node ID.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetNodeId

func (StationURL) ParamValue

func (s StationURL) ParamValue(name string) (string, bool)

ParamValue returns the value of the requested param.

Returns the string value and a bool indicating if the value existed or not.

Originally called nn::nex::StationURL::GetParamValue

func (*StationURL) Parse added in v2.1.0

func (s *StationURL) Parse()

Parse parses the StationURL data from a string

func (StationURL) PlatformType

func (s StationURL) PlatformType() (uint8, bool)

PlatformType gets the stations target platform. Legal values vary by developer and platforms.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetPlatformType

func (*StationURL) PortNumber

func (s *StationURL) PortNumber() (uint16, bool)

PortNumber gets the stations port.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetPortNumber

func (StationURL) PrincipalID

func (s StationURL) PrincipalID() (PID, bool)

PrincipalID gets the stations target PID.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetPrincipalID

func (StationURL) ProbeRequestID

func (s StationURL) ProbeRequestID() (uint32, bool)

ProbeRequestID gets the probe request ID.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetProbeRequestID

func (StationURL) RVConnectionID

func (s StationURL) RVConnectionID() (uint32, bool)

RVConnectionID gets the stations Rendez-Vous connection ID.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetRVConnectionID

func (StationURL) RelayAddress

func (s StationURL) RelayAddress() (string, bool)

RelayAddress gets the address for the relay

Originally called nn::nex::StationURL::GetRelayAddress

func (StationURL) RelayPort

func (s StationURL) RelayPort() (uint16, bool)

RelayPort gets the stations relay port.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetRelayPort

func (StationURL) RelayServerAddress

func (s StationURL) RelayServerAddress() (string, bool)

RelayServerAddress gets the address for the relay server

Originally called nn::nex::StationURL::GetRelayServerAddress

func (StationURL) RelayServerPort

func (s StationURL) RelayServerPort() (uint16, bool)

RelayServerPort gets the stations relay server port.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetRelayServerPort

func (*StationURL) RemoveParam

func (s *StationURL) RemoveParam(name string)

RemoveParam removes a StationURL parameter.

Originally called nn::nex::StationURL::Remove

func (*StationURL) Set added in v2.1.0

func (s *StationURL) Set(name, value string, custom bool)

Set sets a StationURL parameter.

"custom" determines whether or not the parameter is a standard parameter or an application-specific parameter

func (*StationURL) SetAddress

func (s *StationURL) SetAddress(address string)

SetAddress sets the stations IP address

func (*StationURL) SetConnectionID

func (s *StationURL) SetConnectionID(connectionID uint32)

SetConnectionID sets the stations connection ID

Unsure how this differs from the Rendez-Vous connection ID

func (*StationURL) SetFastProbeResponse

func (s *StationURL) SetFastProbeResponse(fast bool)

SetFastProbeResponse sets whether fast probe response should be enabled or not

func (*StationURL) SetNATFiltering

func (s *StationURL) SetNATFiltering(filtering constants.NATFilteringProperties)

SetNATFiltering sets the clients NAT filtering properties

func (*StationURL) SetNATMapping

func (s *StationURL) SetNATMapping(mapping constants.NATMappingProperties)

SetNATMapping sets the clients NAT mapping properties

func (*StationURL) SetNATPMPSupport

func (s *StationURL) SetNATPMPSupport(supported bool)

SetNATPMPSupport sets whether PMP should be enabled or not.

Originally called nn::nex::StationURL::SetNatPMPSupport

func (*StationURL) SetNodeID

func (s *StationURL) SetNodeID(nodeID uint16)

SetNodeID sets the stations node ID

Originally called nn::nex::StationURL::SetNodeId

func (*StationURL) SetParamValue

func (s *StationURL) SetParamValue(name, value string)

SetParamValue sets a StationURL parameter

func (*StationURL) SetPlatformType

func (s *StationURL) SetPlatformType(platformType uint8)

SetPlatformType sets the stations platform type

func (*StationURL) SetPortNumber

func (s *StationURL) SetPortNumber(port uint16)

SetPortNumber sets the stations port

func (*StationURL) SetPrincipalID

func (s *StationURL) SetPrincipalID(pid PID)

SetPrincipalID sets the stations target PID

func (*StationURL) SetProbeRequestID

func (s *StationURL) SetProbeRequestID(probeRequestID uint32)

SetProbeRequestID sets the probe request ID

func (*StationURL) SetProbeRequestInitiation

func (s *StationURL) SetProbeRequestInitiation(probeinit bool)

SetProbeRequestInitiation sets whether probing should begin or not

func (*StationURL) SetRVConnectionID

func (s *StationURL) SetRVConnectionID(connectionID uint32)

SetRVConnectionID sets the stations Rendez-Vous connection ID

Unsure how this differs from the connection ID

func (*StationURL) SetRelayAddress

func (s *StationURL) SetRelayAddress(address string)

SetRelayAddress gets the address for the relay

func (*StationURL) SetRelayPort

func (s *StationURL) SetRelayPort(port uint16)

SetRelayPort sets the port for the relay

func (*StationURL) SetRelayServerAddress

func (s *StationURL) SetRelayServerAddress(address string)

SetRelayServerAddress sets the address for the relay server

func (*StationURL) SetRelayServerPort

func (s *StationURL) SetRelayServerPort(port uint16)

SetRelayServerPort sets the port for the relay server

func (*StationURL) SetStreamID

func (s *StationURL) SetStreamID(streamID uint8)

SetStreamID sets the stations stream ID

See VirtualPort

func (*StationURL) SetStreamType

func (s *StationURL) SetStreamType(streamType constants.StreamType)

SetStreamType sets the stations stream type

See VirtualPort

func (*StationURL) SetType

func (s *StationURL) SetType(flags uint8)

SetType sets the stations type flags

func (*StationURL) SetUPnPSupport

func (s *StationURL) SetUPnPSupport(supported bool)

SetUPnPSupport sets whether UPnP should be enabled or not

func (*StationURL) SetURL added in v2.1.0

func (s *StationURL) SetURL(url string)

SetURL sets the internal url string used for parsing

func (*StationURL) SetURLType

func (s *StationURL) SetURLType(urlType constants.StationURLType)

SetURLType sets the stations URL scheme type

func (*StationURL) SetUseRelayServer

func (s *StationURL) SetUseRelayServer(useRelayServer bool)

SetUseRelayServer sets whether or not a relay server should be used

func (StationURL) StreamID

func (s StationURL) StreamID() (uint8, bool)

StreamID gets the stations stream ID.

See VirtualPort.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetStreamID

func (StationURL) StreamType

func (s StationURL) StreamType() (constants.StreamType, bool)

StreamType gets the stations stream type.

See VirtualPort.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetStreamType

func (StationURL) String

func (s StationURL) String() string

String returns a string representation of the struct

func (StationURL) Type

func (s StationURL) Type() (uint8, bool)

Type gets the stations type flags.

Returns a bool indicating if the parameter existed or not.

Originally called nn::nex::StationURL::GetType

func (StationURL) URL added in v2.1.0

func (s StationURL) URL() string

URL returns the string formatted URL.

Originally called nn::nex::StationURL::GetURL

func (StationURL) URLType

func (s StationURL) URLType() constants.StationURLType

URLType returns the stations scheme type

Originally called nn::nex::StationURL::GetURLType

func (StationURL) WriteTo

func (s StationURL) WriteTo(writable Writable)

WriteTo writes the StationURL to the given writable

type String

type String string

String is an implementation of rdv::String. Type alias of string

func NewString

func NewString(input string) String

NewString returns a new String

func (String) Copy

func (s String) Copy() RVType

Copy returns a pointer to a copy of the String. Requires type assertion when used

func (String) CopyRef added in v2.1.0

func (s String) CopyRef() RVTypePtr

CopyRef copies the current value of the String and returns a pointer to the new copy

func (*String) Deref added in v2.1.0

func (s *String) Deref() RVType

Deref takes a pointer to the String and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (String) Equals

func (s String) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*String) ExtractFrom

func (s *String) ExtractFrom(readable Readable) error

ExtractFrom extracts the String from the given readable

func (String) String

func (s String) String() string

String returns a string representation of the struct

func (String) WriteTo

func (s String) WriteTo(writable Writable)

WriteTo writes the String to the given writable

type Structure

type Structure struct {
	StructureVersion uint8 `json:"structure_version" db:"structure_version" bson:"structure_version" xml:"StructureVersion"`
}

Structure represents a Quazal Rendez-Vous/NEX Structure (custom class) base struct.

func (*Structure) ExtractHeaderFrom

func (s *Structure) ExtractHeaderFrom(readable Readable) error

ExtractHeaderFrom extracts the structure header from the given readable

func (Structure) WriteHeaderTo

func (s Structure) WriteHeaderTo(writable Writable, contentLength uint32)

WriteHeaderTo writes the structure header to the given writable

type UInt16 added in v2.1.0

type UInt16 uint16

UInt16 is a type alias for the Go basic type uint16 for use as an RVType

func NewUInt16 added in v2.1.0

func NewUInt16(input uint16) UInt16

NewUInt16 returns a new UInt16

func (UInt16) Copy added in v2.1.0

func (u16 UInt16) Copy() RVType

Copy returns a pointer to a copy of the UInt16. Requires type assertion when used

func (UInt16) CopyRef added in v2.1.0

func (u16 UInt16) CopyRef() RVTypePtr

CopyRef copies the current value of the UInt16 and returns a pointer to the new copy

func (*UInt16) Deref added in v2.1.0

func (u16 *UInt16) Deref() RVType

Deref takes a pointer to the UInt16 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (UInt16) Equals added in v2.1.0

func (u16 UInt16) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*UInt16) ExtractFrom added in v2.1.0

func (u16 *UInt16) ExtractFrom(readable Readable) error

ExtractFrom extracts the UInt16 value from the given readable

func (UInt16) String added in v2.1.0

func (u16 UInt16) String() string

String returns a string representation of the UInt16

func (UInt16) WriteTo added in v2.1.0

func (u16 UInt16) WriteTo(writable Writable)

WriteTo writes the UInt16 to the given writable

type UInt32 added in v2.1.0

type UInt32 uint32

UInt32 is a type alias for the Go basic type uint32 for use as an RVType

func NewUInt32 added in v2.1.0

func NewUInt32(input uint32) UInt32

NewUInt32 returns a new UInt32

func (UInt32) Copy added in v2.1.0

func (u32 UInt32) Copy() RVType

Copy returns a pointer to a copy of the UInt32. Requires type assertion when used

func (UInt32) CopyRef added in v2.1.0

func (u32 UInt32) CopyRef() RVTypePtr

CopyRef copies the current value of the UInt32 and returns a pointer to the new copy

func (*UInt32) Deref added in v2.1.0

func (u32 *UInt32) Deref() RVType

Deref takes a pointer to the UInt32 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (UInt32) Equals added in v2.1.0

func (u32 UInt32) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*UInt32) ExtractFrom added in v2.1.0

func (u32 *UInt32) ExtractFrom(readable Readable) error

ExtractFrom extracts the UInt32 value from the given readable

func (UInt32) String added in v2.1.0

func (u32 UInt32) String() string

String returns a string representation of the UInt32

func (UInt32) WriteTo added in v2.1.0

func (u32 UInt32) WriteTo(writable Writable)

WriteTo writes the UInt32 to the given writable

type UInt64 added in v2.1.0

type UInt64 uint64

UInt64 is a type alias for the Go basic type uint64 for use as an RVType

func NewUInt64 added in v2.1.0

func NewUInt64(input uint64) UInt64

NewUInt64 returns a new UInt64

func (UInt64) Copy added in v2.1.0

func (u64 UInt64) Copy() RVType

Copy returns a pointer to a copy of the UInt64. Requires type assertion when used

func (UInt64) CopyRef added in v2.1.0

func (u64 UInt64) CopyRef() RVTypePtr

CopyRef copies the current value of the UInt64 and returns a pointer to the new copy

func (*UInt64) Deref added in v2.1.0

func (u64 *UInt64) Deref() RVType

Deref takes a pointer to the UInt64 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (UInt64) Equals added in v2.1.0

func (u64 UInt64) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*UInt64) ExtractFrom added in v2.1.0

func (u64 *UInt64) ExtractFrom(readable Readable) error

ExtractFrom extracts the UInt64 value from the given readable

func (UInt64) String added in v2.1.0

func (u64 UInt64) String() string

String returns a string representation of the UInt64

func (UInt64) WriteTo added in v2.1.0

func (u64 UInt64) WriteTo(writable Writable)

WriteTo writes the UInt64 to the given writable

type UInt8 added in v2.1.0

type UInt8 uint8

UInt8 is a type alias for the Go basic type uint8 for use as an RVType

func NewUInt8 added in v2.1.0

func NewUInt8(input uint8) UInt8

NewUInt8 returns a new UInt8

func (UInt8) Copy added in v2.1.0

func (u8 UInt8) Copy() RVType

Copy returns a pointer to a copy of the UInt8. Requires type assertion when used

func (UInt8) CopyRef added in v2.1.0

func (u8 UInt8) CopyRef() RVTypePtr

CopyRef copies the current value of the UInt8 and returns a pointer to the new copy

func (*UInt8) Deref added in v2.1.0

func (u8 *UInt8) Deref() RVType

Deref takes a pointer to the UInt8 and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (UInt8) Equals added in v2.1.0

func (u8 UInt8) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*UInt8) ExtractFrom added in v2.1.0

func (u8 *UInt8) ExtractFrom(readable Readable) error

ExtractFrom extracts the UInt8 value from the given readable

func (UInt8) String added in v2.1.0

func (u8 UInt8) String() string

String returns a string representation of the UInt8

func (UInt8) WriteTo added in v2.1.0

func (u8 UInt8) WriteTo(writable Writable)

WriteTo writes the UInt8 to the given writable

type Variant

type Variant struct {
	TypeID UInt8  `json:"type_id" db:"type_id" bson:"type_id" xml:"TypeID"`
	Type   RVType `json:"type" db:"type" bson:"type" xml:"Type"`
}

Variant is an implementation of rdv::Variant. This type can hold many other types, denoted by a type ID.

func NewVariant

func NewVariant() Variant

NewVariant returns a new Variant

func (Variant) Copy

func (v Variant) Copy() RVType

Copy returns a pointer to a copy of the Variant. Requires type assertion when used

func (Variant) CopyRef added in v2.1.0

func (v Variant) CopyRef() RVTypePtr

CopyRef copies the current value of the Variant and returns a pointer to the new copy

func (*Variant) Deref added in v2.1.0

func (v *Variant) Deref() RVType

Deref takes a pointer to the Variant and dereferences it to the raw value. Only useful when working with an instance of RVTypePtr

func (Variant) Equals

func (v Variant) Equals(o RVType) bool

Equals checks if the input is equal in value to the current instance

func (*Variant) ExtractFrom

func (v *Variant) ExtractFrom(readable Readable) error

ExtractFrom extracts the Variant from the given readable

func (Variant) FormatToString

func (v Variant) FormatToString(indentationLevel int) string

FormatToString pretty-prints the struct data using the provided indentation level

func (Variant) String

func (v Variant) String() string

String returns a string representation of the struct

func (Variant) WriteTo

func (v Variant) WriteTo(writable Writable)

WriteTo writes the Variant to the given writable

type Writable

type Writable interface {
	StringLengthSize() int        // Returns the size of the length field for rdv::String types. Only 2 and 4 are valid
	PIDSize() int                 // Returns the size of the length fields for nn::nex::PID types. Only 4 and 8 are valid
	UseStructureHeader() bool     // Returns whether or not Structure types should use a header
	CopyNew() Writable            // Returns a new Writable with the same settings, but an empty buffer
	Write(data []byte)            // Writes the provided data to the buffer
	WriteUInt8(value uint8)       // Writes a primitive Go uint8
	WriteUInt16LE(value uint16)   // Writes a primitive Go uint16
	WriteUInt32LE(value uint32)   // Writes a primitive Go uint32
	WriteUInt64LE(value uint64)   // Writes a primitive Go uint64
	WriteInt8(value int8)         // Writes a primitive Go int8
	WriteInt16LE(value int16)     // Writes a primitive Go int16
	WriteInt32LE(value int32)     // Writes a primitive Go int32
	WriteInt64LE(value int64)     // Writes a primitive Go int64
	WriteFloat32LE(value float32) // Writes a primitive Go float32
	WriteFloat64LE(value float64) // Writes a primitive Go float64
	WriteBool(value bool)         // Writes a primitive Go bool
	Bytes() []byte                // Returns the data written to the buffer
}

Writable represents a struct that types can write to

Jump to

Keyboard shortcuts

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