user

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	sync.RWMutex
	Users map[string]*User
}

func NewManager

func NewManager() *Manager

func (*Manager) AddUser

func (m *Manager) AddUser(u *User)

func (*Manager) AllUsers

func (m *Manager) AllUsers() []*User

func (*Manager) GetUser

func (m *Manager) GetUser(id string) *User

func (*Manager) Number

func (m *Manager) Number() int

func (*Manager) RemoveUser

func (m *Manager) RemoveUser(id string)

type NullUser

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

func (*NullUser) Counter

func (u *NullUser) Counter() *atomic.Uint64

func (*NullUser) Level

func (u *NullUser) Level() uint32

func (*NullUser) Secret

func (u *NullUser) Secret() uuid.UUID

func (*NullUser) Uid

func (u *NullUser) Uid() uuid.UUID

type User

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

func NewUser

func NewUser(uid string, level uint32, secret string) *User

func (*User) AddPrefix

func (u *User) AddPrefix(prefix string)

func (*User) Counter

func (u *User) Counter() *atomic.Uint64

func (*User) GetPrefixesNum

func (u *User) GetPrefixesNum() int

func (*User) Level

func (u *User) Level() uint32

func (*User) Secret

func (u *User) Secret() string

func (*User) Uid

func (u *User) Uid() string

Jump to

Keyboard shortcuts

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