user

package
v0.4.0 Latest Latest
Warning

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

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

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