config

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config provides abstraction for key-value runtime store

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

type KVStore interface {
	// IsSet ...
	IsSet(key string) bool
	// Get ...
	Get(key string) interface{}
	// AllKeys ...
	AllKeys() []string
	// GetBool ...
	GetBool(key string) bool
	// GetTime ...
	GetTime(key string) time.Time
	// GetDuration ...
	GetDuration(key string) time.Duration
	// GetInt ...
	GetInt(key string) int
	// GetInt32 ...
	GetInt32(key string) int32
	// GetInt64 ...
	GetInt64(key string) int64
	// GetIntSlice ...
	GetIntSlice(key string) []int
	// GetString ...
	GetString(key string) string
	// GetStringSlice ...
	GetStringSlice(key string) []string
	// GetStringMap ...
	GetStringMap(key string) map[string]interface{}
	// GetStringMapStringSlice ...
	GetStringMapStringSlice(key string) map[string][]string
	// GetFloat64 ...
	GetFloat64(key string) float64
	// GetUint ...
	GetUint(key string) uint
	// GetUint32 ...
	GetUint32(key string) uint32
	// GetUint64 ...
	GetUint64(key string) uint64
	// GetSizeInBytes ...
	GetSizeInBytes(key string) uint
}

KVStore abstracts static-typed values reader from kv-store.

type SyncMapKVStore

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

SyncMapKVStore ...

func NewSyncMapConfig

func NewSyncMapConfig(sm *sync.Map) *SyncMapKVStore

NewSyncMapConfig returns KVStore based on sync.Map storage.

func (*SyncMapKVStore) AllKeys

func (cfg *SyncMapKVStore) AllKeys() []string

AllKeys ...

func (*SyncMapKVStore) Get

func (cfg *SyncMapKVStore) Get(key string) interface{}

Get ...

func (*SyncMapKVStore) GetBool

func (cfg *SyncMapKVStore) GetBool(key string) bool

GetBool ...

func (*SyncMapKVStore) GetDuration

func (cfg *SyncMapKVStore) GetDuration(key string) time.Duration

GetDuration ...

func (*SyncMapKVStore) GetFloat64

func (cfg *SyncMapKVStore) GetFloat64(key string) float64

GetFloat64 ...

func (*SyncMapKVStore) GetInt

func (cfg *SyncMapKVStore) GetInt(key string) int

GetInt ...

func (*SyncMapKVStore) GetInt32

func (cfg *SyncMapKVStore) GetInt32(key string) int32

GetInt32 ...

func (*SyncMapKVStore) GetInt64

func (cfg *SyncMapKVStore) GetInt64(key string) int64

GetInt64 ...

func (*SyncMapKVStore) GetIntSlice

func (cfg *SyncMapKVStore) GetIntSlice(key string) []int

GetIntSlice ...

func (*SyncMapKVStore) GetSizeInBytes

func (cfg *SyncMapKVStore) GetSizeInBytes(key string) uint

GetSizeInBytes ...

func (*SyncMapKVStore) GetString

func (cfg *SyncMapKVStore) GetString(key string) string

GetString ...

func (*SyncMapKVStore) GetStringMap

func (cfg *SyncMapKVStore) GetStringMap(key string) map[string]interface{}

GetStringMap ...

func (*SyncMapKVStore) GetStringMapStringSlice

func (cfg *SyncMapKVStore) GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice ...

func (*SyncMapKVStore) GetStringSlice

func (cfg *SyncMapKVStore) GetStringSlice(key string) []string

GetStringSlice ...

func (*SyncMapKVStore) GetTime

func (cfg *SyncMapKVStore) GetTime(key string) (t time.Time)

GetTime ...

func (*SyncMapKVStore) GetUint

func (cfg *SyncMapKVStore) GetUint(key string) uint

GetUint ...

func (*SyncMapKVStore) GetUint32

func (cfg *SyncMapKVStore) GetUint32(key string) uint32

GetUint32 ...

func (*SyncMapKVStore) GetUint64

func (cfg *SyncMapKVStore) GetUint64(key string) uint64

GetUint64 ...

func (*SyncMapKVStore) IsSet

func (cfg *SyncMapKVStore) IsSet(key string) bool

IsSet ...

func (*SyncMapKVStore) Set

func (cfg *SyncMapKVStore) Set(key string, value interface{})

Set ...

Jump to

Keyboard shortcuts

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