networkdelay

package
v0.2.4-0...-2c2ceb1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PluginName contains the human readable name of the plugin.
	PluginName = "NetworkDelay"

	// CfgNetworkDelayOriginPublicKey defines the config flag of the issuer node public key.
	CfgNetworkDelayOriginPublicKey = "networkdelay.originPublicKey"
)
View Source
const (
	// ObjectName defines the name of the networkdelay object.
	ObjectName = "networkdelay"
)

Variables

View Source
var Type = payload.NewType(189, ObjectName, func(data []byte) (payload payload.Payload, err error) {
	payload, _, err = FromBytes(data)

	return
})

Type represents the identifier which addresses the network delay Object type.

Functions

func App

func App() *node.Plugin

App gets the plugin instance.

Types

type ID

type ID [32]byte

ID represents a 32 byte ID of a network delay object.

func (ID) String

func (id ID) String() string

String returns a human-friendly representation of the ID.

type Object

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

Object represents the network delay object type.

func FromBytes

func FromBytes(bytes []byte) (result *Object, consumedBytes int, err error)

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

func NewObject

func NewObject(id ID, sentTime int64) *Object

NewObject creates a new network delay object.

func Parse

func Parse(marshalUtil *marshalutil.MarshalUtil) (result *Object, err error)

Parse unmarshals an Object using the given marshalUtil (for easier marshaling/unmarshaling).

func (*Object) Bytes

func (o *Object) Bytes() (bytes []byte)

Bytes returns a marshaled version of this Object.

func (*Object) String

func (o *Object) String() string

String returns a human-friendly representation of the Object.

func (*Object) Type

func (o *Object) Type() payload.Type

Type returns the type of the Object.

type Response

type Response struct {
	ID    string `json:"id,omitempty"`
	Error string `json:"error,omitempty"`
}

Response contains the ID of the message sent.

Jump to

Keyboard shortcuts

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