model

package
v0.0.0-...-0d95af9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB() *gorm.DB

GetDB returns an initialized DB

func IsErrorGormNotFound

func IsErrorGormNotFound(err error) bool

IsErrorGormNotFound returns gorm.ErrRecordNotFound

Types

type AmazonClusterModel

type AmazonClusterModel struct {
	ClusterModelId     uint `gorm:"primary_key"`
	NodeSpotPrice      string
	NodeMinCount       int
	NodeMaxCount       int
	NodeImage          string
	MasterInstanceType string
	MasterImage        string
}

AmazonClusterModel describes the amazon cluster model

func (AmazonClusterModel) TableName

func (AmazonClusterModel) TableName() string

TableName sets AmazonClusterModel's table name

type AzureClusterModel

type AzureClusterModel struct {
	ClusterModelId    uint `gorm:"primary_key"`
	ResourceGroup     string
	AgentCount        int
	AgentName         string
	KubernetesVersion string
}

AzureClusterModel describes the azure cluster model

func (AzureClusterModel) TableName

func (AzureClusterModel) TableName() string

TableName sets AzureSimple's table name

type ClusterModel

type ClusterModel struct {
	gorm.Model
	Name             string `gorm:"unique"`
	Location         string
	NodeInstanceType string
	Cloud            string
	Amazon           AmazonClusterModel
	Azure            AzureClusterModel
	Google           GoogleClusterModel
}

ClusterModel describes the common cluster model

func GetSimpleClusterWithId

func GetSimpleClusterWithId(id uint) ClusterModel

GetSimpleClusterWithId returns a simple cluster model

func QueryCluster

func QueryCluster(filter map[string]interface{}) (*ClusterModel, error)

QueryCluster get's the cluster from the DB

func (*ClusterModel) Delete

func (cs *ClusterModel) Delete() error

Delete cluster from DB

func (*ClusterModel) Save

func (cs *ClusterModel) Save() error

Save the cluster to DB

func (*ClusterModel) String

func (cs *ClusterModel) String() string

String method prints formatted cluster fields

func (ClusterModel) TableName

func (ClusterModel) TableName() string

TableName sets ClusterModel's table name

type GoogleClusterModel

type GoogleClusterModel struct {
	ClusterModelId uint `gorm:"primary_key"`
	Project        string
	MasterVersion  string
	NodeVersion    string
	NodeCount      int
	ServiceAccount string
}

GoogleClusterModel describes the google cluster model

func (GoogleClusterModel) TableName

func (GoogleClusterModel) TableName() string

TableName sets the GoogleClusterModel's table name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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