jid

package
v0.74.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Invalid = Jid(-1)
View Source
const Prefix = "Jid." // String prefixing HTML ID's based on Jid's.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jid

type Jid int64

Jid is the basis for the HTML `id` attribute for an UI Element within an active Request. It is per-Request, meaning Jid(1) in one Request is not the same as Jid(1) in another.

func ParseInt

func ParseInt(s string) Jid

ParseInt parses a Jid integer and returns it as a Jid.

Returns jid.Invalid if it's not a valid Jid or an error occurs.

func ParseString

func ParseString(s string) Jid

ParseString parses an unquoted Jid string (e.g. `Jid.2`) and returns the Jid value (e.g. Jid(2)).

Returns jid.Invalid if it's not a valid Jid string.

func (Jid) Append

func (jid Jid) Append(dst []byte) []byte

Append appends the unquoted string format of the Jid.

func (Jid) AppendInt

func (jid Jid) AppendInt(dst []byte) []byte

AppendInt appends just the text format of the Jid's numerical value.

func (Jid) AppendQuote

func (jid Jid) AppendQuote(dst []byte) []byte

AppendQuote appends the string format of the Jid surrounded by double quotes.

func (Jid) AppendStartTagAttr

func (jid Jid) AppendStartTagAttr(dst []byte, startTag string) []byte

AppendAttr appends `<startTag` followed by the quoted Jid as a HTML id attribute.

func (Jid) IsValid

func (jid Jid) IsValid() bool

func (Jid) String

func (jid Jid) String() string

String returns the unquoted string representation of the Jid.

Jump to

Keyboard shortcuts

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