user

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 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 {
	// contains filtered or unexported fields
}

Manager tracks connected Mumble user sessions.

func NewManager

func NewManager(db *gorm.DB, maxUsers int) *Manager

NewManager creates a UserManager.

func (*Manager) Add

func (m *Manager) Add(u *mumble.User) bool

Add adds a connected user. Returns false if username in use or server full.

func (*Manager) Count

func (m *Manager) Count() int

Count returns the number of connected users.

func (*Manager) GetByName

func (m *Manager) GetByName(name string) (*mumble.User, bool)

GetByName returns a user by username.

func (*Manager) GetUser

func (m *Manager) GetUser(sessionID uint32) (*mumble.User, bool)

GetUser returns a user by session ID.

func (*Manager) ListAll

func (m *Manager) ListAll() []*mumble.User

ListAll returns all connected users.

func (*Manager) ListByChannel

func (m *Manager) ListByChannel(channelID uint32) []*mumble.User

ListByChannel returns users in the given channel.

func (*Manager) LookupAPIUser

func (m *Manager) LookupAPIUser(username string) (id uint32, passwordHash string, role string, found bool)

LookupAPIUser looks up an API user by username, returning id, password hash, role, and found. Used for RBAC-aware Mumble auth: id is users.id, role is needed for ACL resolution.

func (*Manager) RegisterDBUser

func (m *Manager) RegisterDBUser(username string) (userID uint32, passwordHash string, found bool)

RegisterDBUser looks up a management/registered user by username.

func (*Manager) Remove

func (m *Manager) Remove(sessionID uint32) *mumble.User

Remove removes a user by session ID.

func (*Manager) SessionIDsInChannel

func (m *Manager) SessionIDsInChannel(channelID uint32) []uint32

SessionIDsInChannel returns session IDs of users in the given channel.

func (*Manager) SetChannel

func (m *Manager) SetChannel(sessionID uint32, channelID uint32)

SetChannel updates a user's channel.

func (*Manager) SetPing

func (m *Manager) SetPing(sessionID uint32, ping float32)

SetPing updates a user's ping (client-reported TCP RTT in ms). Thread-safe.

Jump to

Keyboard shortcuts

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