models

package
v0.0.0-...-29894e9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionKey keys = keys("sessionkey")

Functions

func HashPassword

func HashPassword(password string) (*string, error)

Types

type Asset

type Asset struct {
	Id         interface{} `json:"_id, omitempty" bson:"_id, omitempty"`
	InternalId int         `json:"id" bson:"id"`
	Url        string      `json:"url" bson:"url"`
	Public     bool        `json:"public" bson:"public"`
}

type Project

type Project struct {
	Id      interface{} `json:"_id, omitempty" bson:"_id, omitempty"`
	Title   string      `json:"title" bson:"title"`
	Created time.Time   `json:"created" bson:"created"`
	Renders []Render    `json:"renders" bson:"renders"`
	Path    string      `json:"path" bson:"path"`
}

type Register

type Register struct {
	Id        interface{} `json:"_id,omitempty" bson:"_id,omitempty"`
	Username  string      `json:"username" bson:"username"`
	Password  string      `json:"password" bson:"password"`
	Email     string      `json:"email" bson:"email"`
	Token     string      `json:"token" bson:"token"`
	CreatedAt time.Time   `json:"created_at" bson:"created_at"`
}

func NewRegister

func NewRegister(username, password, email string) (*Register, error)

type Render

type Render struct {
	Id       interface{} `json:"_id, omitempty" bson:"_id, omitempty"`
	Name     string      `json:"name" bson:"name"`
	Status   float64     `json:"status" bson:"status"`
	Started  time.Time   `json:"started" bson:"started"`
	Finished *time.Time  `json:"finished, omitempty" bson:"finished, omitempty"`
	Icon     string      `json:"icon" bson:"icon"`
}

type Session

type Session struct {
	Id   interface{} `json:"_id,omitempty" bson:"_id,omitempty"`
	User *User       `json:"user" bson:"user"`
}

func UseSession

func UseSession(ctx context.Context) *Session

func (Session) Context

func (session Session) Context(ctx context.Context) context.Context

type User

type User struct {
	Id       interface{} `json:"_id,omitempty" bson:"_id,omitempty"`
	Username string      `json:"username" bson:"username"`
	Email    string      `json:"email" bson:"email"`
	Password string      `json:"-" bson:"password"`
	Coins    float64     `json:"coins" bson:"coins"`
	Projects []Project   `json:"projects" bson:"projects"`
}

func (User) CheckPassword

func (user User) CheckPassword(password string) (bool, error)

Jump to

Keyboard shortcuts

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