eventenvelope

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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.

func (*T) UnmarshalJSON

func (env *T) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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