kvlist

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

The deserialization driver for (k, value list).

func (Driver) ShouldUnmarshal

func (u Driver) ShouldUnmarshal(typ reflect.Type) bool

Determine whether we should call the driver to unmarshal values of this type from []byte.

For KVList, this is the case if: - `typ` represents a KVList; and/or - `typ` implements `Unmarshaler`.

func (Driver) Unmarshal

func (u Driver) Unmarshal(in any, out *any) (err error)

Perform unmarshaling.

func (Driver) WrapValue

func (u Driver) WrapValue(wrapped any) shared.Value

type KVList

type KVList map[string][]string

The type of a (key, value list) store.

func (KVList) AsValue

func (list KVList) AsValue() shared.Value

func (KVList) Keys

func (list KVList) Keys() []string

func (KVList) Lookup

func (list KVList) Lookup(key string) (shared.Value, bool)

type Unmarshaler

type Unmarshaler interface {
	Unmarshal([]byte) error
}

A type that supports deserialization from bytes.

type Value

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

func (Value) AsDict

func (v Value) AsDict() (shared.Dict, bool)

A KVValue may never be converted into a string.

func (Value) AsSlice

func (v Value) AsSlice() ([]shared.Value, bool)

func (Value) Interface

func (v Value) Interface() any

Jump to

Keyboard shortcuts

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