models

package
v0.0.0-...-f879ede Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Note: the example only works with the code within the same release/branch.

Index

Constants

This section is empty.

Variables

View Source
var Cache redis.Conn
View Source
var Kubeconfig *string

Functions

func GetClientConfig

func GetClientConfig() (*rest.Config, error)

func GetClientset

func GetClientset() (*kubernetes.Clientset, error)

func GetClientsetFromConfig

func GetClientsetFromConfig(config *rest.Config) (*kubernetes.Clientset, error)

func GetDB

func GetDB() *gorm.DB

func Login

func Login(email, password string, w http.ResponseWriter) map[string]interface{}

func Refresh

func Refresh(w http.ResponseWriter, r *http.Request)

Types

type Account

type Account struct {
	gorm.Model
	FName       string `json:"first_name"`
	LName       string `json:"last_name"`
	Email       string `json:"email"`
	Status      string `json:"status"`
	Standing    string `json:"standing"`
	Password    string `json:"password"`
	Token       string `gorm:"-" ; json:"token"`
	Role        string `json:"role"`
	MFA_Enabled string `json:"mfa_enabled"`
	AccType     string `json:"account_type"`
	Namespace   string
}

a struct to rep user account

func GetUser

func GetUser(u uint) *Account

func GetUserByEmail

func GetUserByEmail(e string) *Account

func UpdateCurrentUser

func UpdateCurrentUser(account *Account) *Account

func (*Account) Create

func (account *Account) Create() map[string]interface{}

func (*Account) Validate

func (account *Account) Validate() (map[string]interface{}, bool)

Validate incoming user details...

type AccountTypes

type AccountTypes struct {
	gorm.Model
	TypeName string `json:"type"`
	Game     string `json:"game"`
	Slots    string `json:"slots"`
	Memory   string `json:"ram"`
}

func GetAllAccountTypes

func GetAllAccountTypes() []*AccountTypes

func GetCurrentAccountType

func GetCurrentAccountType(id uint) *AccountTypes

type ArkPCServer

type ArkPCServer struct {
	gorm.Model
	Name       string `json:"name"`
	UserId     uint
	ServerID   string
	MapName    string `json:"map"`
	ServerPass string `gorm:"-" ; json:"spass"`
	AdminPass  string `gorm:"-" ; json:"apass"`
	Backup     int    `json:"backup"`
	Update     int    `json: "update"`
	Namespace  string `json: "namespace"`
}

func (*ArkPCServer) Create

func (arkPCServer *ArkPCServer) Create() map[string]interface{}

func (*ArkPCServer) Validate

func (arkPCServer *ArkPCServer) Validate() (map[string]interface{}, bool)

type Arma2Server

type Arma2Server struct {
	gorm.Model
	Name   string `json:"name"`
	UserId uint
	Type   string `json: "type"`
}

func GetArma2Server

func GetArma2Server(id uint) *Arma2Server

func GetArma2Servers

func GetArma2Servers(user uint) []*Arma2Server

func (*Arma2Server) Create

func (arma2Server *Arma2Server) Create() map[string]interface{}

func (*Arma2Server) Validate

func (arma2Server *Arma2Server) Validate() (map[string]interface{}, bool)

type AssettoCCServer

type AssettoCCServer struct {
	gorm.Model
	Name   string `json:"name"`
	UserId uint
	Type   string `json: "type"`
}

func GetAssettoCCServer

func GetAssettoCCServer(id uint) *AssettoCCServer

func GetAssettoCCServers

func GetAssettoCCServers(user uint) []*AssettoCCServer

func (*AssettoCCServer) Create

func (assettoCCServer *AssettoCCServer) Create() map[string]interface{}

func (*AssettoCCServer) Validate

func (assettoCCServer *AssettoCCServer) Validate() (map[string]interface{}, bool)

type AvailServer

type AvailServer struct {
	gorm.Model
	Name     string `json:"name"`
	ServerID string `json:"serverID"`
	UserId   uint
}

func GetAvailServer

func GetAvailServer(id uint) *AvailServer

func GetAvailServers

func GetAvailServers() []*AvailServer

func (*AvailServer) Create

func (availServer *AvailServer) Create() map[string]interface{}

func (*AvailServer) Validate

func (availServer *AvailServer) Validate() (map[string]interface{}, bool)

type BasicAccount

type BasicAccount struct {
	gorm.Model
	Email       string `json:"email"`
	FName       string `json:"first_name"`
	LName       string `json:"last_name"`
	Status      string `json:"status`
	Standing    string `json:"standing"`
	MFA_Enabled string `json:"mfa_enabled"`
	AccType     string `json:"account_type"`
}

func GetAllUsers

func GetAllUsers() []*BasicAccount

func GetCurrentUser

func GetCurrentUser(email string) *BasicAccount

type Command

type Command struct {
}

type MinecraftBRServer

type MinecraftBRServer struct {
	gorm.Model
	Name   string `json:"name"`
	UserId uint
	Type   string `json: "type"`
}

func GetMinecraftBRServer

func GetMinecraftBRServer(id uint) *MinecraftBRServer

func GetMinecraftBRServers

func GetMinecraftBRServers(user uint) []*MinecraftBRServer

func (*MinecraftBRServer) Create

func (minecraftBRServer *MinecraftBRServer) Create() map[string]interface{}

func (*MinecraftBRServer) Validate

func (minecraftBRServer *MinecraftBRServer) Validate() (map[string]interface{}, bool)

type Pod

type Pod struct {
	gorm.Model
	Name      string `json:"name"`
	Namespace string `json: "namespace"`
	UserId    uint
	Command   string `json:"command"`
}

func (*Pod) GetPodLogs

func (pod *Pod) GetPodLogs()

func (*Pod) SendCommand

func (pod *Pod) SendCommand()

(string, string, error)

type Token

type Token struct {
	UserId uint
	jwt.StandardClaims
}

JWT claims struct

Jump to

Keyboard shortcuts

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