subscription

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const StdHRP = "su"
View Source
const StdLen = 14

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B = []byte

type Ctx

type Ctx = context.T

type E

type E = error

type Id

type Id struct {
	T B
}

func MustNew

func MustNew[V S | B](s V) *Id

MustNew is the same as NewId except it doesn't check if you feed it rubbish.

DO NOT USE WITHOUT CHECKING THE ID IS NOT NIL AND > 0 AND <= 64

func NewId

func NewId[V S | B](s V) (*Id, error)

NewId inspects a string and converts to Id if it is valid. Invalid means length == 0 or length > 64.

func NewStd

func NewStd() (t *Id)

func (*Id) IsValid

func (si *Id) IsValid() bool

IsValid returns true if the subscription id is between 1 and 64 characters. Invalid means too long or not present.

func (*Id) MarshalJSON

func (si *Id) MarshalJSON(dst B) (b B, err error)

func (*Id) String

func (si *Id) String() S

func (*Id) UnmarshalJSON

func (si *Id) UnmarshalJSON(b B) (r B, err error)

type N

type N = int

type S

type S = string

Jump to

Keyboard shortcuts

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