models

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 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 PermissionModel

type PermissionModel struct {
	ID              int    `json:"id"`
	Name            string `json:"name"`
	Color           string `json:"color"`
	PermissionLevel int    `json:"permission_level"`
}

global model

func (PermissionModel) Parse

func (c PermissionModel) Parse(resp *sql.Rows) PermissionModel

fetch only one [resp.Next() required]

func (PermissionModel) ParseAll

func (c PermissionModel) ParseAll(resp *sql.Rows) []PermissionModel

fetch all

type RefreshTokenModel

type RefreshTokenModel struct {
	ID       int
	Username string
	Token    string
	Deadline time.Time
}

struct defines database model of refresh token

func (RefreshTokenModel) Parse

func (c RefreshTokenModel) Parse(resp *sql.Rows) (bool, RefreshTokenModel)

type TableModel

type TableModel struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Entrys     int    `json:"entrys"`
	MinPermLvl int    `json:"min_perm_lvl"`
	CreatedAt  string `json:"created_at"`
}

global model

func (TableModel) Parse

func (c TableModel) Parse(resp *sql.Rows) TableModel

fetch only one [resp.Next() required]

func (TableModel) ParseAll

func (c TableModel) ParseAll(resp *sql.Rows) []TableModel

fetch all

type TwoFactorModel

type TwoFactorModel struct {
	ID     int    `json:"id"`
	Secret string `json:"secret"`
	Owner  string `json:"owner"`
}

func (TwoFactorModel) Parse

func (c TwoFactorModel) Parse(resp *sql.Rows) TwoFactorModel

func (TwoFactorModel) ParseAll

func (c TwoFactorModel) ParseAll(resp *sql.Rows) []TwoFactorModel

type UserModel

type UserModel struct {
	ID           int       `json:"id"`
	Username     string    `json:"username"`
	Password     string    `json:"password"`
	Token        string    `json:"token"`
	Permissions  string    `json:"permissions"`
	Root         bool      `json:"root"`
	Mail         string    `json:"mail"`
	Displayname  string    `json:"displayname"`
	TwoFactor    bool      `json:"two_factor"`
	RegisterDate time.Time `json:"register_date"`
	Status       string    `json:"status"`
}

global model

func (UserModel) Parse

func (c UserModel) Parse(resp *sql.Rows) UserModel

fetch only one [resp.Next() required]

func (UserModel) ParseAll

func (c UserModel) ParseAll(resp *sql.Rows) []UserModel

fetch all

Jump to

Keyboard shortcuts

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