payload

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

View Source
var Type = payload.Type(200)

Type is the type of the syncbeacon payload.

Functions

func IsSyncBeaconPayload

func IsSyncBeaconPayload(p *Payload) bool

IsSyncBeaconPayload checks if the message is sync beacon payload.

Types

type Payload

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

Payload represents the syncbeacon payload

func FromBytes

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

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 NewSyncBeaconPayload

func NewSyncBeaconPayload(sentTime int64) *Payload

NewSyncBeaconPayload creates a new syncbeacon payload

func (*Payload) Bytes

func (p *Payload) Bytes() []byte

Bytes marshals the syncbeacon payload into a sequence of bytes.

func (*Payload) SentTime

func (p *Payload) SentTime() int64

SentTime returns the time that payload was sent.

func (*Payload) String

func (p *Payload) String() string

String returns a human readable version of syncbeacon payload (for debug purposes).

func (*Payload) Type

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

Type returns the type of the Payload.

func (*Payload) Unmarshal

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

Unmarshal unmarshals a given slice of bytes and fills the object.

Jump to

Keyboard shortcuts

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