eventenvelope

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: GPL-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRawJSON

func FromRawJSON(si string, j []byte) (b []byte)

Types

type T

type T struct {
	// The SubscriptionID field is optional, and may at most contain 64 characters,
	// sufficient for encoding a 256 bit hash as hex.
	SubscriptionID subscriptionid.T
	// The Event is here a pointer because it should not be copied unnecessarily.
	Event *event.T
}

T is the wrapper expected by a relay around an event.

func NewEventEnvelope

func NewEventEnvelope(si string, ev *event.T) (ee *T, err error)

NewEventEnvelope builds an T from a provided T string and pointer to an T, and returns either the T or an error if the Subscription ID is invalid or the T is nil.

func (*T) Bytes

func (env *T) Bytes() (s []byte)

func (*T) Label

func (env *T) Label() string

func (*T) MarshalJSON

func (env *T) MarshalJSON() ([]byte, error)

func (*T) String

func (env *T) String() (s string)

func (*T) ToArray

func (env *T) ToArray() (a array.T)

func (*T) Unmarshal

func (env *T) Unmarshal(buf *text.Buffer) (err error)

Unmarshal the envelope.

Jump to

Keyboard shortcuts

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