Documentation
¶
Index ¶
- Constants
- Variables
- func GetSQLiteAddress(dbName string) string
- type VMap
- func (vm *VMap[kT, vT]) Dump() (keys []kT, vals []vT)
- func (vm *VMap[kT, vT]) Get(key kT) (val vT, ok bool)
- func (kv *VMap[kT, vT]) GetMapWithMutex() (map[kT]vT, *sync.RWMutex)
- func (vm *VMap[kT, vT]) GetUnsafe(key kT) (val vT, ok bool)
- func (vm *VMap[kT, vT]) Make()
- func (vm *VMap[kT, vT]) Set(key kT, val vT)
Constants ¶
View Source
const APP_ID = "net.lugvitc.whats4linux"
View Source
const APP_NAME = "whats4linux"
Variables ¶
View Source
var ConfigDir = defaultConfigDir()
Functions ¶
func GetSQLiteAddress ¶
Types ¶
type VMap ¶
type VMap[kT comparable, vT any] struct { // contains filtered or unexported fields }
VMap is a thread-safe generic map with read-write mutex protection. It provides concurrent access to key-value pairs of any comparable key type.
func NewVMap ¶
func NewVMap[kT comparable, vT any]() VMap[kT, vT]
NewVMap creates and returns a new empty VMap instance with an initialized internal map.
func (*VMap[kT, vT]) Dump ¶
func (vm *VMap[kT, vT]) Dump() (keys []kT, vals []vT)
Dump returns all keys and values as separate slices with write lock protection.
func (*VMap[kT, vT]) GetMapWithMutex ¶
GetMap returns the internal map with read lock protection.
func (*VMap[kT, vT]) GetUnsafe ¶
GetUnsafe retrieves a value without lock protection. Use only when already holding a lock.
Click to show internal directories.
Click to hide internal directories.