model

package
v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockListItem

type BlockListItem struct {
	Username string
	JID      string
}

BlockListItem represents block list item storage entity.

func (*BlockListItem) FromBytes

func (bli *BlockListItem) FromBytes(buf *bytes.Buffer) error

FromBytes deserialize a BlockListItem entiry from its binary representation.

func (*BlockListItem) ToBytes

func (bli *BlockListItem) ToBytes(buf *bytes.Buffer) error

ToBytes converts a BlockListItem entity to its binary representation.

type Role

type Role int

Role represents a user role type.

const (
	// Unknown represents a unknown role.
	Unknown Role = iota
	// Root represents a root role.
	Root
	// Admin represents a admin role.
	Admin
	// Usr represents a user role.
	Usr
)

func ParseRoleString

func ParseRoleString(s string) Role

ParseRoleString parses string to Role.

func (Role) String

func (r Role) String() string

type User

type User struct {
	Username       string
	Password       string
	Role           Role
	LastPresence   *xmpp.Presence
	LastPresenceAt time.Time
}

User represents a user storage entity.

func (*User) FromBytes

func (u *User) FromBytes(buf *bytes.Buffer) error

FromBytes deserializes a User entity from it's gob binary representation.

func (*User) ToBytes

func (u *User) ToBytes(buf *bytes.Buffer) error

ToBytes converts a User entity to it's gob binary representation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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