util

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 41 Imported by: 1

Documentation

Overview

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Code generated from files in client/src/svg. See https://projectforge.dev for details. DO NOT EDIT.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Package util - Content managed by Project Forge, see [projectforge.md] for details.

Index

Constants

View Source
const (
	BoolTrue  = "true"
	BoolFalse = "false"
)
View Source
const (
	AppKey     = "projectforge"
	AppName    = "Project Forge"
	AppSummary = "Build and maintain feature-rich applications using Golang"
	AppPort    = 40000
	AppContact = "Kyle U <projectforge@kyleu.com>"
	AppURL     = "https://projectforge.dev"
	AppSource  = "https://github.com/kyleu/projectforge"
	AppLegal   = `Built by <a href="mailto:projectforge@kyleu.com">Kyle U</a>, all rights reserved`

	KeyError   = "error"
	KeyRandom  = "random"
	KeyUnknown = "unknown"

	ExtJSON     = ".json"
	ExtMarkdown = ".md"

	// $PF_SECTION_START(keys)$.
	DatabaseMySQL      = "mysql"
	DatabasePostgreSQL = "postgres"
	DatabaseSQLite     = "sqlite"
	DatabaseSQLServer  = "sqlserver"

	KeyDetail = "detail"
	KeySimple = "simple"

	ExtCSS  = ".css"
	ExtGo   = ".go"
	ExtHTML = ".html"
	ExtJS   = ".js"
	ExtMod  = ".mod"
	ExtSQL  = ".sql"
	ExtSVG  = ".svg"
	ExtTS   = ".ts"
)

Variables

View Source
var DEBUG = false
View Source
var SVGIconKeys = []string{} /* 144 elements not displayed */
View Source
var SVGLibrary = map[string]string{}/* 145 elements not displayed */
View Source
var StringDefaultLinebreak = func() string {
	if runtime.GOOS == "windows" {
		return winLB
	}
	return saneLB
}()
View Source
var UUIDDefault = uuid.UUID{}

Functions

func ArrayDereference added in v0.9.29

func ArrayDereference[T any](x []*T) []T

func ArrayFirstN added in v0.8.15

func ArrayFirstN[V any](items []V, n int) []V

func ArrayFlatten added in v0.8.15

func ArrayFlatten[T any](arrs ...[]T) []T

func ArrayFromAny added in v0.2.32

func ArrayFromAny(dest any) []any

func ArrayLastN added in v0.8.15

func ArrayLastN[V any](items []V, n int) []V

func ArrayRemoveDuplicates added in v0.2.33

func ArrayRemoveDuplicates[T comparable](x []T) []T

func ArrayRemoveNil added in v0.6.15

func ArrayRemoveNil[T any](x []*T) []*T

func ArraySorted added in v0.10.14

func ArraySorted[T cmp.Ordered](x []T) []T

func ArrayToStringArray added in v1.0.7

func ArrayToStringArray[T any](a []T) []string

func ArrayTransform added in v1.0.6

func ArrayTransform[T any, U any](x []T, f func(T) U) []U

func AsyncCollect added in v0.2.29

func AsyncCollect[T any, R any](items []T, f func(x T) (R, error)) ([]R, []error)

func AsyncCollectMap added in v0.6.9

func AsyncCollectMap[T any, K comparable, R any](items []T, k func(x T) K, f func(x T) (R, error)) (map[K]R, map[K]error)

func AsyncRateLimit added in v0.6.0

func AsyncRateLimit[T any, R any](items []T, f func(x T) (R, error), maxConcurrent int, timeout time.Duration) ([]R, []error)

func ByteSizeIEC added in v0.2.38

func ByteSizeIEC(b int64) string

func ByteSizeSI added in v0.2.38

func ByteSizeSI(b int64) string

func Choose added in v1.0.22

func Choose[T any](b bool, ifTrue T, ifFalse T) T

func CountryFlag added in v0.6.3

func CountryFlag(code string) string

func CycleJSON

func CycleJSON(src any, tgt any) error

func CycleXML added in v1.1.0

func CycleXML(src any, tgt any) error

func DebugBuildInfo added in v0.11.5

func DebugBuildInfo() *debug.BuildInfo

func DebugMemStats added in v0.11.5

func DebugMemStats() *runtime.MemStats

func DebugStartCPUProfile added in v0.11.5

func DebugStartCPUProfile() error

func DebugTakeHeapProfile added in v0.11.5

func DebugTakeHeapProfile() error

func DecryptMessage

func DecryptMessage(key []byte, message string, logger Logger) (string, error)

func DefaultIfNil added in v0.7.21

func DefaultIfNil[T any](ptr *T, d T) T

func EncryptMessage

func EncryptMessage(key []byte, message string, logger Logger) (string, error)

func ErrorMerge added in v0.3.15

func ErrorMerge(errs ...error) error

func Filename added in v1.0.6

func Filename(s string) string

func FromJSON

func FromJSON(msg json.RawMessage, tgt any) error

func FromJSONAny added in v1.1.0

func FromJSONAny(msg json.RawMessage) (any, error)

func FromJSONReader

func FromJSONReader(r io.Reader, tgt any) error

func FromJSONStrict

func FromJSONStrict(msg json.RawMessage, tgt any) error

func FromJSONString added in v0.11.14

func FromJSONString(msg json.RawMessage) (string, error)

func FromXML added in v1.1.0

func FromXML(msg []byte, tgt any) error

func FromXMLAny added in v1.1.0

func FromXMLAny(msg []byte) (any, error)

func FromXMLReader added in v1.1.0

func FromXMLReader(r io.Reader, tgt any) error

func FromXMLStrict added in v1.1.0

func FromXMLStrict(msg []byte, tgt any) error

func FromXMLString added in v1.1.0

func FromXMLString(msg []byte) (string, error)

func GetEnv added in v0.2.9

func GetEnv(name string, defaultValue ...string) string

func GetEnvBool added in v0.2.14

func GetEnvBool(name string, defaultValue bool) bool

func GetEnvDuration added in v0.3.8

func GetEnvDuration(name string, defaultValue time.Duration) time.Duration

func GetEnvInt added in v0.3.1

func GetEnvInt(name string, defaultValue int) int

func HashFNV128UUID added in v1.0.9

func HashFNV128UUID(s string) uuid.UUID

func HashFNV32

func HashFNV32(s string) uint32

func HashSHA256

func HashSHA256(s string) string

HashSHA256 returns a Base64-encoded string representing the SHA-256 hash of the argument.

func InitAcronyms added in v1.0.6

func InitAcronyms(extras ...string) error

func JSONToMap

func JSONToMap(i any) map[string]any

func JoinLines added in v1.1.0

func JoinLines(ss []string, delim string, maxLen int) []string

func JoinLinesFull added in v1.1.0

func JoinLinesFull(ss []string, delim string, maxLen int, prefix string, indent string, suffix string) string

func LengthAny added in v0.2.32

func LengthAny(dest any) int

func MapError added in v1.0.7

func MapError[T any, U any](xa []T, f func(el T, idx int) (U, error)) ([]U, error)

func MarkdownTable added in v0.2.9

func MarkdownTable(header []string, rows [][]string, linebreak string) (string, error)

func MarkdownTableParse added in v1.0.21

func MarkdownTableParse(md string) ([]string, [][]string)

func MicrosToMillis

func MicrosToMillis(i int) string

func RandomBool

func RandomBool() bool

func RandomBytes

func RandomBytes(size int) []byte

func RandomDate

func RandomDate() time.Time

func RandomElements added in v1.0.12

func RandomElements[T any](l []T, x int) []T

func RandomFloat added in v0.5.1

func RandomFloat(maxExclusive int) float64

func RandomIcon added in v1.0.5

func RandomIcon() string

func RandomInt

func RandomInt(maxExclusive int) int

func RandomString

func RandomString(length int) string

func ReplaceEnvVars

func ReplaceEnvVars(s string, logger Logger) string

func RunProcess

func RunProcess(cmd string, path string, in io.Reader, out io.Writer, er io.Writer, env ...string) (int, error)

func RunProcessSimple

func RunProcessSimple(cmd string, path string) (int, string, error)

func StartProcess added in v0.6.10

func StartProcess(cmd string, path string, in io.Reader, out io.Writer, er io.Writer, env ...string) (*exec.Cmd, error)

func StringArrayFromAny added in v1.1.1

func StringArrayFromAny(a []any, maxLength int) []string

func StringArrayMaxLength

func StringArrayMaxLength(a []string) int

func StringArrayOxfordComma

func StringArrayOxfordComma(names []string, separator string) string

func StringArrayQuoted

func StringArrayQuoted(a []string) []string

func StringDetectLinebreak added in v0.10.23

func StringDetectLinebreak(s string) string

func StringForms

func StringForms(s string) (string, string)

func StringNullable added in v1.1.0

func StringNullable(s fmt.Stringer) string

func StringPad

func StringPad(s string, size int) string

func StringPadLeft added in v0.7.10

func StringPadLeft(s string, size int, chr rune) string

func StringPadRight added in v0.7.10

func StringPadRight(s string, size int, chr rune) string

func StringPlural

func StringPlural(count int, s string) string

func StringRepeat

func StringRepeat(s string, n int) string

func StringReplaceBetween added in v0.7.5

func StringReplaceBetween(s string, l string, r string, replacement string) (string, error)

func StringSplit

func StringSplit(s string, sep byte, cutc bool) (string, string)

func StringSplitAndTrim

func StringSplitAndTrim(s string, delim string) []string

func StringSplitLast

func StringSplitLast(s string, sep byte, cutc bool) (string, string)

func StringSplitLastOnly added in v0.10.20

func StringSplitLastOnly(s string, sep byte, cutc bool) string

func StringSplitLines added in v0.10.23

func StringSplitLines(s string) []string

func StringSplitLinesIndented added in v0.12.3

func StringSplitLinesIndented(s string, indent int, indentFirstLine bool, includeEmptyLines bool) []string

func StringSplitPath added in v0.10.20

func StringSplitPath(s string) (string, string)

func StringSplitPathAndTrim added in v0.10.19

func StringSplitPathAndTrim(s string) []string

func StringSubstringBetween added in v0.7.5

func StringSubstringBetween(s string, l string, r string) string

func StringToCamel

func StringToCamel(s string, extraAcronyms ...string) string

func StringToLowerCamel

func StringToLowerCamel(s string, extraAcronyms ...string) string

func StringToPlural

func StringToPlural(s string) string

func StringToSingular

func StringToSingular(s string) string

func StringToSnake added in v0.3.15

func StringToSnake(s string, extraAcronyms ...string) string

func StringToTitle

func StringToTitle(s string, extraAcronyms ...string) string

func StringTruncate

func StringTruncate(s string, max int) string

func TimeCurrent added in v0.10.14

func TimeCurrent() time.Time

func TimeCurrentMillis

func TimeCurrentMillis() int64

func TimeCurrentNanos added in v0.10.14

func TimeCurrentNanos() int64

func TimeCurrentP added in v0.10.14

func TimeCurrentP() *time.Time

func TimeCurrentUnix added in v0.10.14

func TimeCurrentUnix() int64

func TimeFromFull

func TimeFromFull(s string) (*time.Time, error)

func TimeFromFullMS added in v1.0.16

func TimeFromFullMS(s string) (*time.Time, error)

func TimeFromHTML

func TimeFromHTML(s string) (*time.Time, error)

func TimeFromJS

func TimeFromJS(s string) (*time.Time, error)

func TimeFromRFC3339 added in v1.0.26

func TimeFromRFC3339(s string) (*time.Time, error)

func TimeFromString

func TimeFromString(s string) (*time.Time, error)

func TimeFromStringFmt

func TimeFromStringFmt(s string, fmt string) (*time.Time, error)

func TimeFromStringSimple added in v1.0.12

func TimeFromStringSimple(s string) *time.Time

func TimeFromVerbose added in v0.9.17

func TimeFromVerbose(s string) (*time.Time, error)

func TimeFromYMD

func TimeFromYMD(s string) (*time.Time, error)

func TimeRelative

func TimeRelative(t *time.Time) string

func TimeToFull

func TimeToFull(d *time.Time) string

func TimeToFullMS added in v1.0.16

func TimeToFullMS(d *time.Time) string

func TimeToHTML

func TimeToHTML(d *time.Time) string

func TimeToHours added in v1.0.21

func TimeToHours(d *time.Time) string

func TimeToJS

func TimeToJS(d *time.Time) string

func TimeToMap added in v0.6.3

func TimeToMap(t time.Time) map[string]any

func TimeToRFC3339 added in v1.0.26

func TimeToRFC3339(d *time.Time) string

func TimeToString

func TimeToString(d *time.Time, fmt string) string

func TimeToVerbose added in v0.9.17

func TimeToVerbose(d *time.Time) string

func TimeToYMD

func TimeToYMD(d *time.Time) string

func TimeToday added in v0.7.0

func TimeToday() *time.Time

func TimeTruncate added in v0.7.2

func TimeTruncate(t *time.Time) *time.Time

func ToCSV added in v1.1.0

func ToCSV(data any) ([]string, [][]string, error)

func ToCSVBytes added in v1.1.0

func ToCSVBytes(data any) ([]byte, error)

func ToJSON

func ToJSON(x any) string

func ToJSONBytes

func ToJSONBytes(x any, indent bool) []byte

func ToJSONCompact

func ToJSONCompact(x any) string

func ToXML added in v1.1.0

func ToXML(x any) (string, error)

func ToXMLBytes added in v1.1.0

func ToXMLBytes(x any, indent bool) ([]byte, error)

func ToXMLCompact added in v1.1.0

func ToXMLCompact(x any) (string, error)

func UUID

func UUID() uuid.UUID

func UUIDFromString

func UUIDFromString(s string) *uuid.UUID

func UUIDFromStringOK added in v0.8.24

func UUIDFromStringOK(s string) uuid.UUID

func UUIDP

func UUIDP() *uuid.UUID

func UUIDString added in v0.6.24

func UUIDString(u *uuid.UUID) string

Types

type DebugInfo

type DebugInfo struct {
	ServerTags  *OrderedMap[string]
	AppTags     *OrderedMap[string]
	RuntimeTags *OrderedMap[string]
	Mods        []*debug.Module
}

func DebugGetInfo added in v0.11.5

func DebugGetInfo(version string, started time.Time) *DebugInfo

type Diff

type Diff struct {
	Path string `json:"path"`
	Old  string `json:"o,omitempty"`
	New  string `json:"n"`
}

func NewDiff

func NewDiff(p string, o string, n string) *Diff

func (Diff) String

func (d Diff) String() string

func (Diff) StringVerbose added in v0.5.6

func (d Diff) StringVerbose() string

type Diffs

type Diffs []*Diff

func DiffObjects

func DiffObjects(l any, r any, path ...string) Diffs

func DiffObjectsIgnoring

func DiffObjectsIgnoring(l any, r any, ignored []string, path ...string) Diffs

func RandomDiffs

func RandomDiffs(size int) Diffs

func (Diffs) String

func (d Diffs) String() string

func (Diffs) StringVerbose added in v0.5.6

func (d Diffs) StringVerbose() string

type DiffsSet added in v1.0.9

type DiffsSet map[string]Diffs

type ErrorDetail

type ErrorDetail struct {
	Type       string            `json:"type" xml:"type"`
	Message    string            `json:"message" xml:"message"`
	Stack      []ErrorFrame      `json:"stack,omitempty" xml:"stack,omitempty"`
	StackTrace errors.StackTrace `json:"-" xml:"-"`
	Cause      *ErrorDetail      `json:"cause,omitempty" xml:"cause,omitempty"`
}

func GetErrorDetail

func GetErrorDetail(e error, includeStack bool) *ErrorDetail

type ErrorFrame

type ErrorFrame struct {
	Key string `json:"key" xml:"key"`
	Loc string `json:"loc" xml:"loc"`
}

func TraceDetail

func TraceDetail(trace errors.StackTrace) []ErrorFrame

type FieldDesc added in v0.12.0

type FieldDesc struct {
	Key         string `json:"key"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
}

type FieldDescs added in v0.12.0

type FieldDescs []*FieldDesc

func (FieldDescs) Keys added in v1.1.0

func (d FieldDescs) Keys() []string

type KeyTypeDesc added in v0.2.9

type KeyTypeDesc struct {
	Key         string `json:"key"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

func (*KeyTypeDesc) Array added in v0.2.9

func (k *KeyTypeDesc) Array(key string) []string

type KeyTypeDescs added in v0.2.9

type KeyTypeDescs []*KeyTypeDesc

func (KeyTypeDescs) Array added in v0.2.9

func (k KeyTypeDescs) Array(key string) [][]string

func (KeyTypeDescs) Sort added in v0.2.9

func (k KeyTypeDescs) Sort() KeyTypeDescs

type KeyVal added in v0.8.17

type KeyVal[T any] struct {
	Key string `json:"key" db:"key"`
	Val T      `json:"val" db:"val"`
}

func (KeyVal[T]) String added in v0.8.17

func (k KeyVal[T]) String() string

type KeyVals added in v0.8.17

type KeyVals[T any] []*KeyVal[T]

func (KeyVals[T]) String added in v0.8.17

func (k KeyVals[T]) String() string

func (KeyVals[T]) ToMap added in v0.8.17

func (k KeyVals[T]) ToMap() map[string]T

func (KeyVals[T]) Values added in v0.8.17

func (k KeyVals[T]) Values() []T

type Logger added in v0.2.35

type Logger = *zap.SugaredLogger

type Node added in v1.0.18

type Node[T any] struct {
	Name     string   `json:"name"`
	Children Nodes[T] `json:"children,omitempty"`
	Tags     []string `json:"tags,omitempty"`
}

func (*Node[T]) Flatten added in v1.0.18

func (n *Node[T]) Flatten(curr string) []string

func (*Node[T]) Get added in v1.0.18

func (n *Node[T]) Get(pth ...string) *Node[T]

type Nodes added in v1.0.18

type Nodes[T any] []*Node[T]

func (Nodes[T]) Flatten added in v1.0.18

func (n Nodes[T]) Flatten(curr string) []string

func (Nodes[T]) Get added in v1.0.18

func (n Nodes[T]) Get(pth ...string) *Node[T]

func (Nodes[T]) Merge added in v1.0.18

func (n Nodes[T]) Merge(x Nodes[T]) Nodes[T]

func (Nodes[T]) Sort added in v1.0.18

func (n Nodes[T]) Sort() Nodes[T]

type OrderedMap

type OrderedMap[V any] struct {
	Lexical bool
	Order   []string
	Map     map[string]V
}

func NewOrderedMap

func NewOrderedMap[V any](lexical bool, capacity int) *OrderedMap[V]

func (*OrderedMap[V]) Append

func (o *OrderedMap[V]) Append(k string, v V)

func (*OrderedMap[V]) Get

func (o *OrderedMap[V]) Get(k string) (V, bool)

func (*OrderedMap[V]) GetSimple

func (o *OrderedMap[V]) GetSimple(k string) V

func (OrderedMap[V]) MarshalJSON

func (o OrderedMap[V]) MarshalJSON() ([]byte, error)

func (OrderedMap[V]) MarshalXML

func (o OrderedMap[V]) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (OrderedMap[V]) MarshalYAML

func (o OrderedMap[V]) MarshalYAML() (any, error)

func (*OrderedMap[V]) UnmarshalJSON

func (o *OrderedMap[V]) UnmarshalJSON(b []byte) error

type Pkg

type Pkg []string

func (Pkg) Drop

func (p Pkg) Drop(n int) Pkg

func (Pkg) Equals

func (p Pkg) Equals(other Pkg) bool

func (Pkg) Last

func (p Pkg) Last() string

func (Pkg) Push

func (p Pkg) Push(name string) Pkg

func (Pkg) Quoted

func (p Pkg) Quoted(quote string) string

func (Pkg) Shift

func (p Pkg) Shift() Pkg

func (Pkg) StartsWith

func (p Pkg) StartsWith(t Pkg) bool

func (Pkg) String

func (p Pkg) String() string

func (Pkg) StringWith

func (p Pkg) StringWith(extra ...string) string

func (Pkg) ToPath

func (p Pkg) ToPath(extra ...string) string

func (Pkg) Trim

func (p Pkg) Trim(src Pkg) Pkg

func (Pkg) With

func (p Pkg) With(key string) Pkg

type StringSlice added in v1.1.1

type StringSlice struct {
	Slice []string
}

func NewStringSlice added in v1.1.1

func NewStringSlice(a []string) *StringSlice

func (*StringSlice) Empty added in v1.1.1

func (s *StringSlice) Empty() bool

func (*StringSlice) Join added in v1.1.1

func (s *StringSlice) Join(x string) string

func (*StringSlice) Push added in v1.1.1

func (s *StringSlice) Push(strings ...string)

func (*StringSlice) Pushf added in v1.1.1

func (s *StringSlice) Pushf(msg string, args ...any)

func (*StringSlice) Sort added in v1.1.1

func (s *StringSlice) Sort()

type Timer added in v0.2.9

type Timer struct {
	Started   int64 `json:"started"`
	Completed int64 `json:"complete"`
}

func TimerStart

func TimerStart() *Timer

func (*Timer) Elapsed added in v0.2.9

func (t *Timer) Elapsed() int

func (*Timer) End added in v0.2.9

func (t *Timer) End() int

func (*Timer) EndString added in v0.2.9

func (t *Timer) EndString() string

func (*Timer) String added in v0.2.9

func (t *Timer) String() string

type Tree added in v1.0.18

type Tree[T any] struct {
	Nodes  Nodes[T] `json:"nodes,omitempty"`
	Config ValueMap `json:"config,omitempty"`
}

func (Tree[T]) Flatten added in v1.0.18

func (t Tree[T]) Flatten() []string

func (Tree[T]) Merge added in v1.0.18

func (t Tree[T]) Merge(x *Tree[T]) *Tree[T]

type ValueMap

type ValueMap map[string]any

func FromJSONMap added in v0.11.14

func FromJSONMap(msg json.RawMessage) (ValueMap, error)

func FromXMLMap added in v1.1.0

func FromXMLMap(msg []byte) (ValueMap, error)

func RandomValueMap

func RandomValueMap(keys int) ValueMap

func ValueMapFor

func ValueMapFor(kvs ...any) ValueMap

func (ValueMap) Add

func (m ValueMap) Add(kvs ...any)

func (ValueMap) AsChanges

func (m ValueMap) AsChanges() (ValueMap, error)

func (ValueMap) Clone

func (m ValueMap) Clone() ValueMap

func (ValueMap) Filter added in v0.7.13

func (m ValueMap) Filter(keys []string) ValueMap

func (ValueMap) GetArray

func (m ValueMap) GetArray(key string, allowEmpty bool) ([]any, error)

func (ValueMap) GetArrayOpt added in v1.0.7

func (m ValueMap) GetArrayOpt(key string) []any

func (ValueMap) GetBool

func (m ValueMap) GetBool(key string, allowEmpty bool) (bool, error)

func (ValueMap) GetBoolOpt added in v0.2.33

func (m ValueMap) GetBoolOpt(key string) bool

func (ValueMap) GetFloat

func (m ValueMap) GetFloat(key string, allowEmpty bool) (float64, error)

func (ValueMap) GetFloatArray added in v1.0.7

func (m ValueMap) GetFloatArray(key string, allowEmpty bool) ([]float64, error)

func (ValueMap) GetFloatOpt added in v1.0.7

func (m ValueMap) GetFloatOpt(key string) float64

func (ValueMap) GetInt

func (m ValueMap) GetInt(key string, allowEmpty bool) (int, error)

func (ValueMap) GetInt64

func (m ValueMap) GetInt64(key string, allowEmpty bool) (int64, error)

func (ValueMap) GetIntArray added in v1.0.7

func (m ValueMap) GetIntArray(key string, allowEmpty bool) ([]int, error)

func (ValueMap) GetIntOpt added in v0.6.4

func (m ValueMap) GetIntOpt(key string) int

func (ValueMap) GetMap

func (m ValueMap) GetMap(key string, allowEmpty bool) (ValueMap, error)

func (ValueMap) GetMapArray added in v1.0.7

func (m ValueMap) GetMapArray(key string, allowEmpty bool) ([]ValueMap, error)

func (ValueMap) GetMapOpt added in v1.0.7

func (m ValueMap) GetMapOpt(key string) ValueMap

func (ValueMap) GetPath

func (m ValueMap) GetPath(path string, allowMissing bool) (any, error)

func (ValueMap) GetRequired

func (m ValueMap) GetRequired(k string) (any, error)

func (ValueMap) GetString

func (m ValueMap) GetString(key string, allowEmpty bool) (string, error)

func (ValueMap) GetStringArray

func (m ValueMap) GetStringArray(key string, allowEmpty bool) ([]string, error)

func (ValueMap) GetStringArrayOpt added in v1.0.7

func (m ValueMap) GetStringArrayOpt(key string) []string

func (ValueMap) GetStringOpt

func (m ValueMap) GetStringOpt(key string) string

func (ValueMap) GetStringPtr added in v0.8.23

func (m ValueMap) GetStringPtr(key string) *string

func (ValueMap) GetTime

func (m ValueMap) GetTime(key string, allowEmpty bool) (*time.Time, error)

func (ValueMap) GetTimeOpt added in v1.0.7

func (m ValueMap) GetTimeOpt(key string) time.Time

func (ValueMap) GetType

func (m ValueMap) GetType(key string, ret any) error

func (ValueMap) GetUUID

func (m ValueMap) GetUUID(key string, allowEmpty bool) (*uuid.UUID, error)

func (ValueMap) GetUUIDOpt added in v1.0.7

func (m ValueMap) GetUUIDOpt(key string) uuid.UUID

func (ValueMap) HasKey added in v1.0.10

func (m ValueMap) HasKey(key string) bool

func (ValueMap) Keys

func (m ValueMap) Keys() []string

func (ValueMap) KeysAndValues

func (m ValueMap) KeysAndValues() ([]string, []any)

func (ValueMap) MarshalXML

func (m ValueMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (ValueMap) Merge

func (m ValueMap) Merge(args ...ValueMap) ValueMap

func (ValueMap) Overwrite added in v0.7.13

func (m ValueMap) Overwrite(sourceMap ValueMap) ValueMap

func (ValueMap) ParseArray

func (m ValueMap) ParseArray(path string, allowMissing bool, allowEmpty bool, coerce bool) ([]any, error)

func (ValueMap) ParseArrayFloat added in v1.0.7

func (m ValueMap) ParseArrayFloat(path string, allowMissing bool, allowEmpty bool) ([]float64, error)

func (ValueMap) ParseArrayInt added in v0.3.16

func (m ValueMap) ParseArrayInt(path string, allowMissing bool, allowEmpty bool) ([]int, error)

func (ValueMap) ParseArrayMap added in v1.0.7

func (m ValueMap) ParseArrayMap(path string, allowMissing bool, allowEmpty bool) ([]ValueMap, error)

func (ValueMap) ParseArrayString added in v0.3.16

func (m ValueMap) ParseArrayString(path string, allowMissing bool, allowEmpty bool) ([]string, error)

func (ValueMap) ParseBool

func (m ValueMap) ParseBool(path string, allowMissing bool, allowEmpty bool) (bool, error)

func (ValueMap) ParseFloat

func (m ValueMap) ParseFloat(path string, allowMissing bool, allowEmpty bool) (float64, error)

func (ValueMap) ParseInt

func (m ValueMap) ParseInt(path string, allowMissing bool, allowEmpty bool) (int, error)

func (ValueMap) ParseMap

func (m ValueMap) ParseMap(path string, allowMissing bool, allowEmpty bool) (ValueMap, error)

func (ValueMap) ParseString

func (m ValueMap) ParseString(path string, allowMissing bool, allowEmpty bool) (string, error)

func (ValueMap) ParseTime

func (m ValueMap) ParseTime(path string, allowMissing bool, allowEmpty bool) (*time.Time, error)

func (ValueMap) ParseUUID

func (m ValueMap) ParseUUID(path string, allowMissing bool, allowEmpty bool) (*uuid.UUID, error)

func (ValueMap) SetPath

func (m ValueMap) SetPath(path string, val any) error

func (ValueMap) String added in v1.1.0

func (m ValueMap) String() string

func (ValueMap) ToQueryString

func (m ValueMap) ToQueryString() string

func (ValueMap) ToStringMap added in v0.11.6

func (m ValueMap) ToStringMap() map[string]string

Jump to

Keyboard shortcuts

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