entity

package
v0.0.0-...-2d52d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecordNotFound = errors.New("Not Found")
)

Errors for entities

Functions

This section is empty.

Types

type DatabaseUser

type DatabaseUser struct {
	ID        uint   `gorm:"primary_key"`
	UUID      string `gorm:"size:36;not null"`
	Password  string `gorm:"size:64;not null"`
	Email     string `gorm:"size:64;not null"`
	FirstName string `gorm:"size:64;not null"`
	LastName  string `gorm:"size:64;not null"`
}

DatabaseUser the the database structure for User objects

func (DatabaseUser) TableName

func (d DatabaseUser) TableName() string

TableName for GORM

type ServerStatus

type ServerStatus struct {
	SetupRequired bool `json:"setupRequired"`
}

ServerStatus is the status of the server

type Session

type Session struct {
	Token   string      `json:"token"`
	Context UserContext `json:"context"`
}

Session is all of the user data needed for the session

type User

type User struct {
	UUID      string `json:"uuid"`
	Password  string `json:"-"`
	Email     string `json:"email"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

User for Hub Users

type UserContext

type UserContext struct {
	User     User         `json:"user"`
	Settings UserSettings `json:"userSettings"`
}

UserContext is all of the data surrounding a User

type UserCreateRequest

type UserCreateRequest struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

UserCreateRequest is the request for creating users

type UserDeleteRequest

type UserDeleteRequest struct {
	UUID string `json:"uuid"`
}

UserDeleteRequest is the request for deleting a user

type UserLoginRequest

type UserLoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

UserLoginRequest is the request for logging in

type UserSettings

type UserSettings struct {
	ThemeColorLight string `json:"themeColorLight"`
	ThemeColorDark  string `json:"themeColorDark"`
}

UserSettings for a User

type UserUpdateRequest

type UserUpdateRequest struct {
	UUID            string `json:"uuid"`
	FirstName       string `json:"firstName"`
	LastName        string `json:"lastName"`
	Email           string `json:"email"`
	ThemeColorLight string `json:"themeColorLight"`
	ThemeColorDark  string `json:"themeColorDark"`
}

UserUpdateRequest is the request for updating users

Jump to

Keyboard shortcuts

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