controllers

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster is the management layer for clusters

func NewClusterController

func NewClusterController(dbConn *gorm.DB) *Cluster

NewController accepts a gorm DB connection and returns a new instance of the cluster controller

func (*Cluster) CreateNew

func (clusterController *Cluster) CreateNew(newCluster models.CreateClusterRequest) (models.Cluster, error)

CreateNew is the public api on the clusterController for persisting a new service entity to the data store

func (Cluster) DoesClusterExist

func (clusterController Cluster) DoesClusterExist(name string) (id int, ok bool)

DoesClusterExist is a helper method to check if a cluster with the given name already exists in sherlock's data storage

func (*Cluster) FindOrCreate

func (clusterController *Cluster) FindOrCreate(name string) (int, error)

FindOrCreate will attempt to look an cluster by name and return its ID if successful if unsuccessful it will create a new cluster from the provider name and return that id

func (*Cluster) GetByID

func (clusterController *Cluster) GetByID(id int) (models.Cluster, error)

GetByID is the public API for looking up a cluster from the data store by name

func (*Cluster) GetByName

func (clusterController *Cluster) GetByName(name string) (models.Cluster, error)

GetByName is the public API for looking up a cluster from the data store by name

func (*Cluster) ListAll

func (clusterController *Cluster) ListAll() ([]models.Cluster, error)

ListAll is the public api for listing out all clusters tracked by sherlock

Jump to

Keyboard shortcuts

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