objects

package module
v0.0.0-...-589861e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

maps

Documentation

Index

Constants

View Source
const (
	TypeMap    = types.TypeMap
	TypeSlice  = types.TypeSlice
	TypeStruct = types.TypeStruct
)

Variables

View Source
var (
	ErrOutOfBounds    = types.ErrOutOfBounds
	ErrEmpty          = types.ErrEmpty
	ErrNotFound       = types.ErrNotFound
	ErrNotDone        = types.ErrNotDone
	ErrUnexpectedType = types.ErrUnexpectedType
)
View Source
var DefaultOptions = &Options{
	StructField: DefaultField,
}

Functions

func Copy

func Copy(ctx context.Context, w Writer, r Reader) error

func DefaultField

func DefaultField(f reflect.StructField) string

func Del

func Del(ctx context.Context, w Writer, keys ...string) error

func Get

func Get(ctx context.Context, r Reader, keys ...string) (any, error)

func Set

func Set(ctx context.Context, w Writer, v any, keys ...string) (bool, error)

func TGet

func TGet[T any](ctx context.Context, r Reader, keys ...string) (T, error)

Types

type Error

type Error = types.Error

type Interface

type Interface = types.Interface

type Iter

type Iter = types.Iter

func Reverse

func Reverse(it Iter) Iter

func Walk

func Walk(r Reader) Iter

type Key

type Key = types.Key

type ListerTo

type ListerTo = types.ListerTo

type Map

type Map struct {
	// contains filtered or unexported fields
}

func (*Map) Get

func (m *Map) Get(ctx context.Context, key string) (any, bool)

func (*Map) List

func (m *Map) List(ctx context.Context) []string

func (*Map) ListTo

func (m *Map) ListTo(ctx context.Context, keys *[]string)

func (*Map) SafeGet

func (m *Map) SafeGet(ctx context.Context, key string) (any, error)

func (*Map) Type

func (m *Map) Type() Type

type Options

type Options struct {
	StructField func(reflect.StructField) string
}

type Prefixed

type Prefixed = types.Prefixed

type PrefixedReader

type PrefixedReader = types.PrefixedReader

type PrefixedWriter

type PrefixedWriter = types.PrefixedWriter

type Reader

type Reader = types.Reader

func Make

func Make(v any) Reader

func TeeReader

func TeeReader(r Reader, w Writer) Reader

type SafeInterface

type SafeInterface = types.SafeInterface

type SafeReader

type SafeReader = types.SafeReader

type SafeWriter

type SafeWriter = types.SafeWriter

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

func (*Slice) Get

func (s *Slice) Get(ctx context.Context, key string) (any, bool)

func (*Slice) List

func (s *Slice) List(ctx context.Context) []string

func (*Slice) ListTo

func (s *Slice) ListTo(ctx context.Context, keys *[]string)

func (*Slice) SafeGet

func (s *Slice) SafeGet(ctx context.Context, key string) (any, error)

func (*Slice) Type

func (s *Slice) Type() Type

type Struct

type Struct struct {
	// contains filtered or unexported fields
}

func (*Struct) Get

func (s *Struct) Get(ctx context.Context, key string) (any, bool)

func (*Struct) List

func (s *Struct) List(ctx context.Context) []string

func (*Struct) ListTo

func (s *Struct) ListTo(ctx context.Context, keys *[]string)

func (*Struct) SafeGet

func (s *Struct) SafeGet(ctx context.Context, key string) (any, error)

func (*Struct) Type

func (s *Struct) Type() Type

type Type

type Type = types.Type

type Writer

type Writer = types.Writer

func Put

func Put(ctx context.Context, w Writer, hint Type, keys ...string) (Writer, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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