Documentation
¶
Index ¶
- Variables
- type Raid
- func (rr Raid) Bytes() []byte
- func (rr Raid) Compare(r Raid) int
- func (rr Raid) Encode(dst []byte)
- func (rr Raid) IsNil() bool
- func (rr Raid) IsZero() bool
- func (rr Raid) Less(r Raid) bool
- func (rr Raid) MarshalJSON() ([]byte, error)
- func (rr Raid) MarshalText() ([]byte, error)
- func (rr Raid) Message() uint16
- func (rr Raid) Prefix() string
- func (rr *Raid) Scan(value any) error
- func (rr Raid) String() string
- func (rr Raid) Time() time.Time
- func (rr *Raid) UnmarshalJSON(b []byte) error
- func (rr *Raid) UnmarshalText(b []byte) error
- func (rr Raid) Value() (driver.Value, error)
- func (rr Raid) WithMessage(msg uint16) Raid
- func (rr Raid) WithPrefix(prefix string) Raid
- func (rr Raid) WithPrefixByte(prefix []byte) Raid
- func (rr Raid) WithRandom() Raid
- func (rr Raid) WithTimestamp(t time.Time) Raid
- func (rr Raid) WithTimestampNow() Raid
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidId = errors.New("raid: invalid raid id")
)
View Source
var (
NilRaid = Raid{}
)
Functions ¶
This section is empty.
Types ¶
type Raid ¶
type Raid [20]byte
Raid is 20 byte identifier. 2 byte prefix -- enough for 3 characters in base32. 4 byte unix seconds timestamp -- make id became sortable. 2 byte message -- 16 bit message, masked with 15th and 16th byte. 12 byte randoms -- 96 bit randoms, make id un guessable
func RaidFromString ¶
func (Raid) MarshalJSON ¶
func (Raid) MarshalText ¶
func (*Raid) UnmarshalJSON ¶
func (*Raid) UnmarshalText ¶
func (Raid) WithMessage ¶
func (Raid) WithPrefix ¶
func (Raid) WithPrefixByte ¶
func (Raid) WithRandom ¶
func (Raid) WithTimestampNow ¶
Click to show internal directories.
Click to hide internal directories.