misc

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const APP_ID = "net.lugvitc.whats4linux"
View Source
const APP_NAME = "whats4linux"

Variables

View Source
var ConfigDir = defaultConfigDir()

Functions

func GetSQLiteAddress

func GetSQLiteAddress(dbName string) string

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]) Get

func (vm *VMap[kT, vT]) Get(key kT) (val vT, ok bool)

Get retrieves a value for the given key with read lock protection.

func (*VMap[kT, vT]) GetMapWithMutex

func (kv *VMap[kT, vT]) GetMapWithMutex() (map[kT]vT, *sync.RWMutex)

GetMap returns the internal map with read lock protection.

func (*VMap[kT, vT]) GetUnsafe

func (vm *VMap[kT, vT]) GetUnsafe(key kT) (val vT, ok bool)

GetUnsafe retrieves a value without lock protection. Use only when already holding a lock.

func (*VMap[kT, vT]) Make

func (vm *VMap[kT, vT]) Make()

Make initializes the internal map. Call this to reset the map or if using a zero-value VMap.

func (*VMap[kT, vT]) Set

func (vm *VMap[kT, vT]) Set(key kT, val vT)

Set stores a value for the given key with write lock protection.

Jump to

Keyboard shortcuts

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