payload

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ObjectName defines the name of the dRNG object.
	ObjectName = "dRNG"
)

Variables

View Source
var Type = payload.Type(111)

Type defines the type of the drng payload.

Functions

This section is empty.

Types

type Payload

type Payload struct {
	header.Header
	Data []byte
	// contains filtered or unexported fields
}

Payload defines a DRNG payload.

func FromBytes

func FromBytes(bytes []byte, optionalTargetObject ...*Payload) (result *Payload, consumedBytes int, err error)

FromBytes parses the marshaled version of a Payload into an object. It either returns a new Payload or fills an optionally provided Payload with the parsed information.

func New

func New(header header.Header, data []byte) *Payload

New creates a new DRNG payload.

func Parse

func Parse(marshalUtil *marshalutil.MarshalUtil) (*Payload, error)

Parse is a wrapper for simplified unmarshaling in a byte stream using the marshalUtil package.

func (*Payload) Bytes

func (payload *Payload) Bytes() (bytes []byte)

Bytes returns the drng payload bytes.

func (*Payload) Marshal

func (payload *Payload) Marshal() (bytes []byte, err error)

Marshal marshals the drng payload into bytes.

func (*Payload) String

func (payload *Payload) String() string

func (*Payload) Type

func (payload *Payload) Type() payload.Type

Type returns the type of the drng payload.

func (*Payload) Unmarshal

func (payload *Payload) Unmarshal(data []byte) (err error)

Unmarshal unmarshals the given bytes into a drng payload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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