user

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package user provides a User object and it's associated methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User added in v1.4.0

type User struct {
	AuthorId       string
	AuthorName     string
	ChanPermission int64
	Mention        string
	RatCookie      string
	RatExpire      time.Time
	UserInfo       *models.RegisteredUser
}

User is a struct of user object. Each incoming message in the command_handler will try to create a User object based on the message it received

func NewUser added in v1.4.0

func NewUser(d *gorm.DB, c *viper.Viper, i string) (*User, error)

NewUser creates and returns a new User object

func (*User) HasRatCookie added in v1.4.0

func (u *User) HasRatCookie() bool

HasRatCookie returns true when *User has a valid SoT RAT cookie set in the database

func (*User) IsAdmin added in v1.4.0

func (u *User) IsAdmin() bool

IsAdmin returns true when *User has channel admin permission

func (*User) IsRegistered added in v1.4.0

func (u *User) IsRegistered() bool

IsRegistered return true when *User is registered

func (*User) RatIsValid added in v1.4.7

func (u *User) RatIsValid() bool

RatIsValid returns true when the RAT cookie of *User is still valid

Jump to

Keyboard shortcuts

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