tag

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StructTag

type StructTag string

StructTag in go are, by convention, key:"value" pairs; this extends that for sub-tags within the value part of the pair.

func ReadTag

func ReadTag(f r.StructTag) StructTag

ReadTag parses tags of the format `if:"one,two,key=value"`.

func (StructTag) Exists

func (t StructTag) Exists(key string) (okay bool)

Exists returns true if Find returns true.

func (StructTag) Find

func (t StructTag) Find(key string) (ret string, okay bool)

Find finds the named key within the struct tag. ex. for the tag, `if:"internal"` Find("internal") returns "internal". the tag, `if:"beep=boop"` Find("beep") return "boop".

func (StructTag) Split

func (t StructTag) Split() []string

Split returns the comma separate subparts of the tag's value.

func (StructTag) String

func (t StructTag) String() string

String returns the entire value of the golang key:"value" pair.

Jump to

Keyboard shortcuts

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