reason

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthRequired = R("auth-required")
	PoW          = R("pow")
	Duplicate    = R("duplicate")
	Blocked      = R("blocked")
	RateLimited  = R("rate-limited")
	Invalid      = R("invalid")
	Error        = R("error")
	Unsupported  = R("unsupported")
	Restricted   = R("restricted")
)

Functions

func Msg

func Msg(prefix R, format string, params ...any) (o []byte)

Msg constructs a properly formatted message with a machine-readable prefix for OK and CLOSED envelopes.

Types

type R

type R []byte

R is the machine-readable prefix before the colon in an OK or CLOSED envelope message. Below are the most common kinds that are mentioned in NIP-01.

func (R) B

func (r R) B() []byte

B returns the R as a byte slice.

func (R) F

func (r R) F(format string, params ...any) (o []byte)

F allows creation of a full R text with a printf style format.

func (R) IsPrefix

func (r R) IsPrefix(reason []byte) bool

IsPrefix returns whether a text contains the same R prefix.

func (R) S

func (r R) S() string

S returns the R as a string

Jump to

Keyboard shortcuts

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