store

package
v0.0.0-...-3192b2a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultPersistentStorage

func SetDefaultPersistentStorage(impl PersistentStorageDelegate)

Types

type DefaultPersistentImpl

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

func (*DefaultPersistentImpl) DeleteKeyValue

func (p *DefaultPersistentImpl) DeleteKeyValue(key string) error

func (*DefaultPersistentImpl) DoesKeyExist

func (p *DefaultPersistentImpl) DoesKeyExist(key string) bool

func (*DefaultPersistentImpl) GetKeyValue

func (p *DefaultPersistentImpl) GetKeyValue(key string, outValue any) error

func (*DefaultPersistentImpl) SetKeyValue

func (p *DefaultPersistentImpl) SetKeyValue(key string, value any) error

func (*DefaultPersistentImpl) SetStorage

func (p *DefaultPersistentImpl) SetStorage(storage KvsStorage)

type KvsPersistentStorage

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

func NewInitStorage

func NewInitStorage(fileName string) *KvsPersistentStorage

func (*KvsPersistentStorage) Delete

func (s *KvsPersistentStorage) Delete(key string) error

func (*KvsPersistentStorage) DeleteAll

func (s *KvsPersistentStorage) DeleteAll() error

func (*KvsPersistentStorage) HasValue

func (s *KvsPersistentStorage) HasValue(key string) bool

func (*KvsPersistentStorage) Init

func (s *KvsPersistentStorage) Init(mConfigPath string) error

func (*KvsPersistentStorage) ReadValueBin

func (s *KvsPersistentStorage) ReadValueBin(key string) ([]byte, error)

func (*KvsPersistentStorage) ReadValueBool

func (s *KvsPersistentStorage) ReadValueBool(key string) (bool, error)

func (*KvsPersistentStorage) ReadValueFloat

func (s *KvsPersistentStorage) ReadValueFloat(key string) (float64, error)

func (*KvsPersistentStorage) ReadValueInt

func (s *KvsPersistentStorage) ReadValueInt(key string) (int64, error)

func (*KvsPersistentStorage) ReadValueStr

func (s *KvsPersistentStorage) ReadValueStr(key string) (string, error)

func (*KvsPersistentStorage) ReadValueString

func (s *KvsPersistentStorage) ReadValueString(key string) (string, error)

func (*KvsPersistentStorage) ReadValueUint

func (s *KvsPersistentStorage) ReadValueUint(key string) (uint64, error)

func (*KvsPersistentStorage) ReadValueUint16

func (s *KvsPersistentStorage) ReadValueUint16(key string) (uint16, error)

func (*KvsPersistentStorage) WriteValue

func (s *KvsPersistentStorage) WriteValue(k string, v any) error

func (*KvsPersistentStorage) WriteValueBool

func (s *KvsPersistentStorage) WriteValueBool(key string, v bool) error

func (*KvsPersistentStorage) WriteValueFloat

func (s *KvsPersistentStorage) WriteValueFloat(key string, v float64) error

func (*KvsPersistentStorage) WriteValueInt

func (s *KvsPersistentStorage) WriteValueInt(k string, v int64) error

func (*KvsPersistentStorage) WriteValueString

func (s *KvsPersistentStorage) WriteValueString(key string, v string) error

func (*KvsPersistentStorage) WriteValueUint

func (s *KvsPersistentStorage) WriteValueUint(key string, v uint64) error

func (*KvsPersistentStorage) WriteValueUint16

func (s *KvsPersistentStorage) WriteValueUint16(key string, v uint16) error

func (*KvsPersistentStorage) WriteValueUint32

func (s *KvsPersistentStorage) WriteValueUint32(key string, v uint32) error

type KvsStorage

type KvsStorage interface {
	WriteValue(key string, val any) error

	ReadValueUint(key string) (uint64, error)
	WriteValueUint(string, uint64) error

	ReadValueFloat(key string) (float64, error)
	WriteValueFloat(string, float64) error

	ReadValueBool(key string) (bool, error)
	WriteValueBool(string, bool) error

	ReadValueInt(key string) (int64, error)
	WriteValueInt(string, int64) error

	ReadValueString(key string) (string, error)
	WriteValueString(string, string) error

	HasValue(key string) bool

	Delete(key string) error

	DeleteAll() error
}

type PersistentStorageDelegate

type PersistentStorageDelegate interface {
	SetStorage(storage KvsStorage)

	DeleteKeyValue(key string) error
	DoesKeyExist(key string) bool
	SetKeyValue(key string, value any) error
	GetKeyValue(key string, outValue any) error
}

func DefaultPersistentStorage

func DefaultPersistentStorage() PersistentStorageDelegate

Jump to

Keyboard shortcuts

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