user

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User added in v0.3.0

type User struct {
	Bio        string
	MemberOf   []int
	Pfp        []byte
	Username   string
	Visibility prot.UserVisibility
}

Data of a user

type UserBind added in v0.3.0

type UserBind struct {
	Pfp      binding.Bytes
	Username binding.String
}

Bindings to data of a user

type UserCache added in v0.3.0

type UserCache struct {
	// Cache of this client's user, this same pointer should also be present in Users at any time after logging in
	ThisUser *User
	// Cache of other users' data
	//  Key (string) - Username
	//  Val (User) - User data
	Users map[string]*User
	// Binding to cache of other users' data
	UsersBind map[string]*UserBind
}

Data about the client's user and other user data received from the server

func NewUserCache added in v0.4.0

func NewUserCache() *UserCache

func (*UserCache) CacheUserBack added in v0.4.0

func (u *UserCache) CacheUserBack(userRaw prot.UserRaw)

Caches all avaliable data of a user

func (*UserCache) CacheUserFront added in v0.4.0

func (u *UserCache) CacheUserFront(usernames []string)

Caches only the data of a user required to render a message from or card of them

func (*UserCache) SetThisUser added in v0.4.0

func (u *UserCache) SetThisUser(username string) error

Jump to

Keyboard shortcuts

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