tag

package
v0.400.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIllegalTagType errIllegalTagType

ErrIllegalTagType is returned when a UI tag type is disallowed.

View Source
var ErrNotComparable errNotComparable

ErrNotComparable is returned when a UI object or tag is not comparable.

View Source
var ErrNotUsableAsTag errNotUsableAsTag

ErrNotUsableAsTag is returned when a value cannot be used as a tag.

It is also matchable as ErrNotComparable for backwards compatibility.

View Source
var ErrTooManyTags = errTooManyTags{}

Functions

func FindTagGetter

func FindTagGetter(x any) (path string, tgType reflect.Type, found bool)

FindTagGetter searches x recursively for a nested TagGetter.

func MustTagExpand

func MustTagExpand(ctx Context, tag any) []any

func NewErrNotComparable

func NewErrNotComparable(x any) error

NewErrNotComparable returns ErrNotComparable if x is not comparable.

func NewErrNotUsableAsTag

func NewErrNotUsableAsTag(x any) error

NewErrNotUsableAsTag returns ErrNotUsableAsTag if x cannot be used as a tag.

func TagExpand

func TagExpand(ctx Context, tag any) ([]any, error)

func TagString

func TagString(tag any) string

Types

type Context

type Context interface {
	// Initial returns the Request's initial HTTP request, or nil.
	Initial() (r *http.Request)
	// Get returns the jaws session value for the key, or nil.
	Get(key string) any
	// Set sets the jaws session value for the key.
	Set(key string, val any)
	// Context returns the Request's context.
	Context() (ctx context.Context)
	// Log sends an error to the Logger set in the Jaws.
	// Has no effect if the err is nil or the Logger is nil.
	// Returns err.
	Log(err error) error
	// MustLog sends an error to the Logger set in the Jaws or
	// panics with the given error if no Logger is set.
	// Has no effect if the err is nil.
	MustLog(err error)
}

type Tag

type Tag string

type TagGetter

type TagGetter interface {
	JawsGetTag(ctx Context) any // Note that the Context may be nil
}

Jump to

Keyboard shortcuts

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