eventid

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromBytes

func NewFromBytes(b B) (ei *T, err E)

func NewFromString

func NewFromString(s S) (ei *T, err E)

NewFromString inspects a string and ensures it is a valid, 64 character long hexadecimal string, returns the string coerced to the type.

Types

type B

type B = []byte

type E

type E = error

type S

type S = string

type T

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

T is the SHA256 hash in hexadecimal of the canonical form of an event as produced by the output of T.ToCanonical().Bytes().

func Gen

func Gen() (ei *T)

Gen creates a fake pseudorandom generated event ID for tests.

func New

func New() (ei *T)

func NewWith

func NewWith[V S | B](s V) (ei *T)

func (*T) ByteString

func (ei *T) ByteString(src B) (b B)

func (*T) Bytes

func (ei *T) Bytes() (b B)

func (*T) Equal

func (ei *T) Equal(ei2 *T) bool

func (*T) Len

func (ei *T) Len() int

func (*T) MarshalJSON

func (ei *T) MarshalJSON() (b B, err E)

func (*T) Set

func (ei *T) Set(b B) (err E)

func (*T) String

func (ei *T) String() S

func (*T) UnmarshalJSON

func (ei *T) UnmarshalJSON(b B) (err E)

Jump to

Keyboard shortcuts

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