Documentation ¶
Index ¶
- Constants
- Variables
- func AddFuncMaps(funcName string, f interface{})
- func DefaultNumber[T Number](vals ...T) T
- func DefaultPointer[T any](vals ...*T) *T
- func DefaultString(vals ...string) string
- func E[T any](_ T, err error) error
- func Filter[T any](old []T, f func(item T) bool) []T
- func Find[T any](s []T, t T, compare func(a, b T) bool) int
- func Has[T any](s []T, t T, compare func(a, b T) bool) bool
- func Include[T comparable](s []T, t T) bool
- func Index[T comparable](s []T, t T) int
- func Interfaces[T any](objs []T) []interface{}
- func JSONStringer(v any) fmt.Stringer
- func Limit[T any](s []T, limit int, hidePosition int, manySuffix ...T) []T
- func M[T any](v T, err error) T
- func Map[S any, T any](old []S, f func(item S) T) []T
- func Merge[M ~map[K]V, K comparable, V any](maps ...M) M
- func NewStringer(stringer func() string) fmt.Stringer
- func P[T any](o T) *T
- func Pipe[sT any, dT any](v sT, e error) func(func(sT) (dT, error)) (dT, error)
- func StringEqual(a, b string) bool
- func T[vT any](expr bool, trueVal, falseVal vT) vT
- type Comparable
- type Equal
- type Group
- type Number
- type OneOrMore
- type RingQueue
- type SortedMap
- type SortedMapItem
- type Stringer
- type Template
- func (t *Template) DefinedTemplates() string
- func (t *Template) Execute(wr io.Writer, data any) error
- func (t *Template) ExecuteTemplate(wr io.Writer, name string, data any) error
- func (t *Template) ExecuteToString(data any) (string, error)
- func (t Template) MarshalJSON() ([]byte, error)
- func (t Template) MarshalYAML() (interface{}, error)
- func (t *Template) Name() string
- func (t *Template) UnmarshalJSON(data []byte) (err error)
- func (t *Template) UnmarshalYAML(value *yaml.Node) (err error)
- type TemplateHandler
Constants ¶
View Source
const ( PosRight = iota PosLeft PosCenter )
Variables ¶
View Source
var ( //nolint:revive QueueFull = errors.New("queue is full") //nolint:revive QueueNull = errors.New("queue is null") )
View Source
var ErrStopping = errors.New("program stopping")
View Source
var ExitFunc = os.Exit
View Source
var NopInterrupt = func(err error) {}
Functions ¶
func AddFuncMaps ¶ added in v1.1.4
func AddFuncMaps(funcName string, f interface{})
func DefaultNumber ¶ added in v1.2.0
func DefaultNumber[T Number](vals ...T) T
func DefaultPointer ¶ added in v1.2.0
func DefaultPointer[T any](vals ...*T) *T
func DefaultString ¶ added in v1.2.0
func Include ¶
func Include[T comparable](s []T, t T) bool
func Index ¶
func Index[T comparable](s []T, t T) int
func Interfaces ¶
func Interfaces[T any](objs []T) []interface{}
func JSONStringer ¶
func Merge ¶ added in v1.2.3
func Merge[M ~map[K]V, K comparable, V any](maps ...M) M
func NewStringer ¶
func StringEqual ¶ added in v1.1.2
Types ¶
type Comparable ¶ added in v1.1.5
type OneOrMore ¶ added in v1.1.2
type OneOrMore[T any] []T
OneOrMore represents a value that can either be a string or an array of strings. Mainly here for serialization purposes
func (OneOrMore[T]) Contains ¶ added in v1.1.2
Contains returns true when the value is contained in the slice
func (OneOrMore[T]) MarshalJSON ¶ added in v1.1.2
MarshalJSON converts this string or array to a JSON array or JSON string
func (OneOrMore[T]) MarshalYAML ¶ added in v1.1.2
func (*OneOrMore[T]) UnmarshalJSON ¶ added in v1.1.2
UnmarshalJSON unmarshals this string or array object from a JSON array or signal JSON value
func (*OneOrMore[T]) UnmarshalYAML ¶ added in v1.1.2
type RingQueue ¶ added in v1.1.14
type RingQueue[T any] struct { // contains filtered or unexported fields }
func NewRingQueue ¶ added in v1.1.14
type SortedMap ¶ added in v1.1.5
type SortedMap[K Comparable, V any] []SortedMapItem[K, V]
func NewSortedMap ¶ added in v1.1.5
func NewSortedMap[K Comparable, V any](kvs ...map[K]V) SortedMap[K, V]
type SortedMapItem ¶ added in v1.1.5
type SortedMapItem[K Comparable, V any] struct { Key K Value V }
type Template ¶ added in v1.1.3
type Template struct {
// contains filtered or unexported fields
}
func NewHTMLTemplate ¶ added in v1.2.6
func NewTextTemplate ¶ added in v1.2.6
func (*Template) DefinedTemplates ¶ added in v1.1.3
func (*Template) ExecuteTemplate ¶ added in v1.1.3
func (*Template) ExecuteToString ¶ added in v1.2.6
func (Template) MarshalJSON ¶ added in v1.1.3
func (Template) MarshalYAML ¶ added in v1.1.3
func (*Template) UnmarshalJSON ¶ added in v1.1.3
func (*Template) UnmarshalYAML ¶ added in v1.1.3
Click to show internal directories.
Click to hide internal directories.