cached

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserHomeDir

func GetUserHomeDir() string

func NewUsernameMap

func NewUsernameMap() *usernameMap

Types

type Gid

type Gid = string

type Groupname

type Groupname = string

func GetGroupname

func GetGroupname(g Gid) Groupname

func GetUsername

func GetUsername(u Uid) Groupname

type GroupnameMap

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

GroupnameMap is a map from Gid to Groupname

func NewGroupnameMap

func NewGroupnameMap() *GroupnameMap

func (*GroupnameMap) Get

func (m *GroupnameMap) Get(g Gid) Groupname

type Map

type Map[k constval.Hashable, v any] struct {
	*haxmap.Map[k, v]
}

func NewCacheMap

func NewCacheMap[k constval.Hashable, v any](len int) *Map[k, v]

func (Map[k, v]) Keys

func (m Map[k, v]) Keys() []k

func (Map[k, v]) Pairs

func (m Map[k, v]) Pairs() []Pair[k, v]

func (Map[k, v]) Values

func (m Map[k, v]) Values() []v

type Pair

type Pair[T, U any] struct {
	First  T
	Second U
}

Pair is a struct that contains two variables ptr

func MakePair

func MakePair[T, U any](first T, second U) Pair[T, U]

MakePair return a new Pair receive two value

func (Pair[T, U]) Key

func (p Pair[T, U]) Key() T

func (*Pair[T, U]) Set

func (p *Pair[T, U]) Set(first T, second U)

Set the pair Copy the `first` and `second` to the pair

func (Pair[T, U]) Value

func (p Pair[T, U]) Value() U

type Uid

type Uid = string

type Username

type Username = string

Jump to

Keyboard shortcuts

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