kvm

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RxStoreKey = regexp.MustCompile(`^([^:]+):(\d+):(.*)$`)

Functions

This section is empty.

Types

type HashMap

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

func NewHashMap

func NewHashMap(store KeyValueStore, name string, keys ...string) (h *HashMap, err error)

func (*HashMap) Append

func (h *HashMap) Append(key string, value interface{}) (err error)

func (*HashMap) Get

func (h *HashMap) Get(key string, index int) (value interface{}, err error)

func (*HashMap) Iterate

func (h *HashMap) Iterate(key string, iterator KeyValueIteratorFunc) (err error)

func (*HashMap) Set

func (h *HashMap) Set(key string, index int, value interface{}) (err error)

type KeyValueIteratorFunc

type KeyValueIteratorFunc func(key string, value string) bool

type KeyValueStore

type KeyValueStore interface {
	Get(key string) (value string, err error)
	Set(key, value string) (err error)
	Iterate(pattern string, iterator KeyValueIteratorFunc) (err error)
}

type Value

type Value struct {
	Time     *time.Time     `json:"time,omitempty"`
	Duration *time.Duration `json:"duration,omitempty"`

	Bool    *bool    `json:"bool,omitempty"`
	String  *string  `json:"string,omitempty"`
	Int     *int     `json:"int,omitempty"`
	Int8    *int8    `json:"int8,omitempty"`
	Int16   *int16   `json:"int16,omitempty"`
	Int32   *int32   `json:"int32,omitempty"`
	Int64   *int64   `json:"int64,omitempty"`
	Uint    *uint    `json:"uint,omitempty"`
	Uint8   *uint8   `json:"uint8,omitempty"`
	Uint16  *uint16  `json:"uint16,omitempty"`
	Uint32  *uint32  `json:"uint32,omitempty"`
	Uint64  *uint64  `json:"uint64,omitempty"`
	Float32 *float32 `json:"float32,omitempty"`
	Float64 *float64 `json:"float64,omitempty"`

	SliceBool    *[]bool    `json:"slice-bool,omitempty"`
	SliceString  *[]string  `json:"slice-string,omitempty"`
	SliceInt     *[]int     `json:"slice-int,omitempty"`
	SliceInt8    *[]int8    `json:"slice-int8,omitempty"`
	SliceInt16   *[]int16   `json:"slice-int16,omitempty"`
	SliceInt32   *[]int32   `json:"slice-int32,omitempty"`
	SliceInt64   *[]int64   `json:"slice-int64,omitempty"`
	SliceUint    *[]uint    `json:"slice-uint,omitempty"`
	SliceUint8   *[]uint8   `json:"slice-uint8,omitempty"`
	SliceUint16  *[]uint16  `json:"slice-uint16,omitempty"`
	SliceUint32  *[]uint32  `json:"slice-uint32,omitempty"`
	SliceUint64  *[]uint64  `json:"slice-uint64,omitempty"`
	SliceFloat32 *[]float32 `json:"slice-float32,omitempty"`
	SliceFloat64 *[]float64 `json:"slice-float64,omitempty"`

	SliceInterface *[]interface{} `json:"slice-interface,omitempty"`
	Interface      *interface{}   `json:"interface,omitempty"`
}

func NewValue

func NewValue(from interface{}) (value *Value)

func NewValueFromTypeData

func NewValueFromTypeData(vType, vData string) (value *Value, err error)

func (*Value) Get

func (v *Value) Get() (value interface{})

func (*Value) GetKV

func (v *Value) GetKV() (key string, value interface{})

func (Value) MarshalBinary

func (v Value) MarshalBinary() ([]byte, error)

func (*Value) UnmarshalBinary

func (v *Value) UnmarshalBinary(b []byte) error

Jump to

Keyboard shortcuts

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