models

package
v1.1.3-0...-aec955e Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DB is a connection to your database to be used throughout your application.

Functions

This section is empty.

Types

type Location

type Location struct {
	ID          int       `json:"id" db:"id"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	Name        string    `json:"name" db:"name"`
	Code        string    `json:"code" db:"code"`
	Description string    `json:"description" db:"description"`
}

func (*Location) BeforeDestroy

func (l *Location) BeforeDestroy(tx *pop.Connection) error

func (*Location) Validate

func (l *Location) Validate(tx *pop.Connection) (*validate.Errors, error)

type Locations

type Locations []Location

type Node

type Node struct {
	ID          int       `json:"id" db:"id"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	Uuid        string    `json:"uuid" db:"uuid"`
	Name        string    `json:"name" db:"name"`
	Description string    `json:"description" db:"description"`
	LocationId  int       `json:"location_id" db:"location_id"`
	PublicIp    string    `json:"public_ip" db:"public_ip"`
	PrivateIp   string    `json:"private_ip" db:"private_ip"`
	Port        int       `json:"port" db:"port"`
}

func CreateNode

func CreateNode() *Node

func (*Node) BeforeDestroy

func (n *Node) BeforeDestroy(tx *pop.Connection) error

func (*Node) Validate

func (n *Node) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate" method. This method is not required and may be deleted.

type Nodes

type Nodes []Node

type OAuthClient

type OAuthClient struct {
	ID          int    `json:"id" db:"id"`
	Name        string `json:"name" db:"name"`
	UserId      int    `json:"user_id" db:"user_id"`
	ServerId    int    `json:"server_id" db:"server_id"`
	Secret      string `json:"secret" db:"secret"`
	Description string `json:"description" db:"description"`
}

type Server

type Server struct {
	ID        int       `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	Uuid      uuid.UUID `json:"uuid" db:"uuid"`
	Name      string    `json:"name" db:"name"`
	UserId    int       `json:"user_id" db:"user_id"`
	NodeId    int       `json:"node_id" db:"node_id"`
}

func CreateServer

func CreateServer() *Server

func (*Server) Validate

func (s *Server) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate" method. This method is not required and may be deleted.

type Servers

type Servers []Server

type User

type User struct {
	ID        int       `json:"id" db:"id"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
	Uuid      uuid.UUID `json:"uuid" db:"uuid"`
	Username  string    `json:"username" db:"username"`
	Email     string    `json:"email" db:"email"`
	Language  string    `json:"language" db:"language"`
	Admin     bool      `json:"admin" db:"admin"`

	//private variable that's just backed by the database, we do not pass these outside this
	Password string `json:"-" db:"password"`
}

func CreateUser

func CreateUser() *User

func (*User) BeforeDestroy

func (u *User) BeforeDestroy(tx *pop.Connection) error

func (User) ComparePassword

func (u User) ComparePassword(password string) bool

func (User) SetPassword

func (u User) SetPassword(password string) error

func (*User) Validate

func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate" method. This method is not required and may be deleted.

type Users

type Users []User

Jump to

Keyboard shortcuts

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