model

package
v0.0.0-...-afd1d67 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	// General user information
	ID        string `json:"id" db:"id"`
	Email     string `json:"email" db:"email"`
	Password  string `json:"password" db:"password"`
	Role      string `json:"role" db:"role"`
	DiscordID string `json:"discord_id" db:"discord_id"`
	Upgraded  bool   `json:"upgraded" db:"upgraded"`

	// Timestamps
	AccessExpiresAt *time.Time `json:"access_expires_at" db:"access_expires_at"`
	CreatedAt       *time.Time `json:"created_at" db:"created_at"`
}

func NewUserWithDefaults

func NewUserWithDefaults() *User

type UserSnapshot

type UserSnapshot struct {
	ID              string     `json:"user_id"`           // User ID
	Token           string     `json:"token_id"`          // User token associated with the session
	Role            string     `json:"role"`              // User role
	Upgraded        bool       `json:"upgraded"`          // User upgraded status
	Grants          []string   `json:"grants"`            // User authorization grants
	AccessExpiresAt *time.Time `json:"access_expires_at"` // Expiration timestamp of the user's access to the bot
}

func (*UserSnapshot) MarshalBinary

func (us *UserSnapshot) MarshalBinary() ([]byte, error)

func (*UserSnapshot) UnmarshalBinary

func (us *UserSnapshot) UnmarshalBinary(b []byte) error

Jump to

Keyboard shortcuts

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