Documentation
¶
Index ¶
- Variables
- func GetIDs[T any](s Storage, ids ...ID) (map[ID]T, error)
- func GetSlice[T any](s Storage, id ID) ([]T, error)
- func GetSliceOf[T any](s Storage, ids []ID) (map[ID]T, error)
- func GetVar[T any](s Storage, id ID) (T, error)
- func HasVar[T any](s Storage, id ID) bool
- func SetVar[T any](s Storage, id ID, val T) error
- func SetVarAtKey[K, T any](k Keyed[K], key K, val T) error
- func SetVarAtKeys[K comparable, T any](k Keyed[K], vals map[K]T) error
- func SetVars[T any](s Storage, vals map[ID]T) error
- func VarAtKey[K, T any](k Keyed[K], key K) (T, error)
- type AllowedOp
- func (op AllowedOp) EnsureAllowed(other AllowedOp) error
- func (op AllowedOp) EnsureOverwrite() error
- func (op AllowedOp) EnsureSet() error
- func (op AllowedOp) IsAllowed(other AllowedOp) bool
- func (x AllowedOp) MarshalText() ([]byte, error)
- func (x AllowedOp) String() string
- func (x *AllowedOp) UnmarshalText(text []byte) error
- type AnyMap
- type AnySet
- type AnySetToID
- type AnySlice
- type Cache
- type Dynamic
- type DynamicMap
- type ErrMismatchedTypes
- type ErrNoSuchVar
- type ID
- type Keyed
- type Map
- type MapMethods
- type Of
- type Raw
- type RawMap
- type RawMutex
- type RawSet
- type RuntimeMethods
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoMut = fmt.Errorf("setting and/or overwriting elements disallowed") ErrNoOverwrite = fmt.Errorf("overwriting existing elements is not allowed") )
Functions ¶
func SetVarAtKey ¶
func SetVarAtKeys ¶
func SetVarAtKeys[K comparable, T any](k Keyed[K], vals map[K]T) error
Types ¶
type AllowedOp ¶
type AllowedOp int
ENUM(
Get Set Overwrite
)
func ParseAllowedOp ¶
ParseAllowedOp attempts to convert a string to a AllowedOp.
func (AllowedOp) EnsureAllowed ¶
func (AllowedOp) EnsureOverwrite ¶
func (AllowedOp) MarshalText ¶
MarshalText implements the text marshaller method.
func (*AllowedOp) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type AnySetToID ¶
type DynamicMap ¶
type ErrMismatchedTypes ¶
func (ErrMismatchedTypes) Error ¶
func (err ErrMismatchedTypes) Error() string
func (ErrMismatchedTypes) FormatError ¶
func (err ErrMismatchedTypes) FormatError(w io.Writer) error
type ErrNoSuchVar ¶
func (ErrNoSuchVar) Error ¶
func (err ErrNoSuchVar) Error() string
func (ErrNoSuchVar) FormatError ¶
func (err ErrNoSuchVar) FormatError(w io.Writer) error
type MapMethods ¶
type MapMethods struct { GetVal func(dm DynamicMap, keys []any) (any, bool) SetVal func(dm DynamicMap, keys []any, val any) }
type RawMap ¶
type RawMap struct {
// contains filtered or unexported fields
}
func NewMapStorage ¶
func NewMapStorage() RawMap
type RuntimeMethods ¶
Click to show internal directories.
Click to hide internal directories.