bytemap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

DigiStratum GoLib - ByteMap

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteMap

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

func NewByteMap

func NewByteMap() *ByteMap

func (*ByteMap) Copy

func (r *ByteMap) Copy() *ByteMap

Get a full (deep) copy of this ByteMap This is so that we can give away a copy to someone else without allowing them to tamper with us ref: https://developer20.com/be-aware-of-coping-in-go/

func (*ByteMap) Drop

func (r *ByteMap) Drop(key string) *ByteMap

Drop a single key from the bytemap, if it's set

func (*ByteMap) DropAll

func (r *ByteMap) DropAll()

Drop all keys/values (reset to empty state)

func (*ByteMap) DropSet

func (r *ByteMap) DropSet(keys *[]string) *ByteMap

Drop an set of keys from the bytemap, if any are set

func (*ByteMap) Get

func (r *ByteMap) Get(key string) *[]byte

Get a single data element by key name

func (*ByteMap) GetBool

func (r *ByteMap) GetBool(key string) bool

Get a single data element by key name as a boolean

func (*ByteMap) GetInt64

func (r *ByteMap) GetInt64(key string) *int64

Get a single data element by key name as an int64

func (*ByteMap) GetIterator

func (r *ByteMap) GetIterator() func() interface{}

Iterate over all of our items, returning each as a *KeyValuePair in the form of an interface{}

func (*ByteMap) GetKeys

func (r *ByteMap) GetKeys() []string

Get the set of keys currently loaded into this bytemap

func (*ByteMap) GetSubset

func (r *ByteMap) GetSubset(keys *[]string) *ByteMap

Make a new bytemap from a subset of the key-values from this one

func (*ByteMap) Has

func (r *ByteMap) Has(key string) bool

Check whether we have a data element by key name

func (*ByteMap) HasAll

func (r *ByteMap) HasAll(keys *[]string) bool

Check whether we have configuration elements for all the key names

func (*ByteMap) IsEmpty

func (r *ByteMap) IsEmpty() bool

Check whether this ByteMap is empty (has no properties)

func (*ByteMap) Merge

func (r *ByteMap) Merge(mergeHash ByteMapIfc)

Merge some additional data on top of our own

func (*ByteMap) Set

func (r *ByteMap) Set(key string, value []byte)

Set a single data element key to the specified value

func (*ByteMap) Size

func (r *ByteMap) Size() int

Get the number of properties in this ByteMap

type ByteMapIfc

type ByteMapIfc interface {
	Copy() *ByteMap
	Merge(mergeHash ByteMapIfc)
	IsEmpty() bool
	Size() int
	Set(key string, value []byte)
	Get(key string) *[]byte
	GetInt64(key string) *int64
	GetBool(key string) bool
	GetKeys() []string
	Has(key string) bool
	HasAll(keys *[]string) bool
	GetSubset(keys *[]string) *ByteMap
	Drop(key string) *ByteMap
	DropSet(keys *[]string) *ByteMap
	DropAll()
	GetIterator() func() interface{}
}

ByteMap public interface

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value []byte
}

Jump to

Keyboard shortcuts

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