Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClusterNotFound = gorm.ErrRecordNotFound
ErrClusterNotFound is the error to represent a failed lookup of a cluster db record
Functions ¶
func NewClusterStore ¶
creates a db connection via gorm
Types ¶
type Cluster ¶
type Cluster struct { ID int `gorm:"primaryKey;uniqueIndex"` Name string `gorm:"not null;default:null"` GoogleProject string CreatedAt time.Time UpdatedAt time.Time }
Cluster is the data structure that models a persisted to a database via gorm
type ClusterStore ¶
type ClusterStore interface { ListAll() ([]Cluster, error) CreateNew(CreateClusterRequest) (Cluster, error) GetByID(int) (Cluster, error) GetByName(string) (Cluster, error) }
clusterStore is the interface defining allowed db actions for Cluster
type CreateClusterRequest ¶
type CreateClusterRequest struct {
Name string `json:"name" binding:"required"`
}
CreateClusterRequest struct defines the data required to create a new cluster in db
func (CreateClusterRequest) ClusterReq ¶
func (createClusterRequest CreateClusterRequest) ClusterReq() Cluster
creates a cluster entity object to be persisted with the database from a request to create a cluster.
Click to show internal directories.
Click to hide internal directories.