models

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PENDING = iota
	COMPLETE
	ERROR
	CANCELED
)

Variables

View Source
var Engine *xorm.Engine
View Source
var KEKParams = &argon2id.Params{
	Memory:      32 * 1024,
	Iterations:  8,
	Parallelism: 4,
	SaltLength:  16,
	KeyLength:   32,
}

Functions

func CloseDB

func CloseDB()

func GetAWSSettings

func GetAWSSettings() (string, string)

func GetDefaultRegion

func GetDefaultRegion() string

func GetEncryptedData

func GetEncryptedData() (string, string)

func GetMachineId

func GetMachineId(uuid string) int64

func GetPasswordHash

func GetPasswordHash() string

func GetRole

func GetRole() awsclient.AWSRole

func GetSecurityGroupId

func GetSecurityGroupId(streamSW awsclient.StreamSoftware, region string) string

func IsFirstRun

func IsFirstRun() bool

func IsInit

func IsInit() error

Types

type Machine

type Machine struct {
	Id             int64
	Name           string
	Uuid           string
	AmiId          string
	SnapshotId     string
	Region         string
	AdminPassword  string
	StreamSoftware awsclient.StreamSoftware
	InstanceType   string
	Size           int32
	Deleted        bool
}

func NewMachine

func NewMachine(name string, region string, streamSw awsclient.StreamSoftware, instanceType string, size int32) Machine

type MachineDetail

type MachineDetail struct {
	Status        MachineStatus `json:"status"`
	Uuid          string        `json:"uuid"`
	Name          string        `json:"name"`
	Region        string        `json:"region"`
	InstanceType  string        `json:"instanceType"`
	AmiId         string        `json:"amiId"`
	SnapshotId    string        `json:"snapshotId"`
	Size          int32         `json:"size"`
	AdminPassword string        `json:"adminPwd"`
}

func GetMachines

func GetMachines() []MachineDetail

type MachineStatus

type MachineStatus = string
const (
	MachineStatusOnline      MachineStatus = "online"
	MachineStatusOffline     MachineStatus = "offline"
	MachineStatusUnavailable MachineStatus = "unavailable"
	MachineStatusUnknown     MachineStatus = "unknown"
)

type Settings

type Settings struct {
	Key   string `xorm:"not null unique index"`
	Value string
}

func (*Settings) Insert

func (s *Settings) Insert() (bool, error)

func (*Settings) Update

func (s *Settings) Update() (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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