allocationpools

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package allocationPools defines data structure representing a allocationPool instance and methods for interacting with them it is left to concrete implementations in package db or others to implement these interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationPoolController

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

AllocationPoolController is the management layer for allocationPools

func NewController

func NewController(dbConn *gorm.DB) *AllocationPoolController

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

func (*AllocationPoolController) AddEnvironmentByID

func (allocationPoolController *AllocationPoolController) AddEnvironmentByID(currentAllocationPool models.AllocationPool, environmentID int) (models.AllocationPool, error)

AddEnvironmentByID takes a AllocationPoolObject and associates an existing environment to it.

func (*AllocationPoolController) CreateNew

func (allocationPoolController *AllocationPoolController) CreateNew(newAllocationPool models.CreateAllocationPoolRequest) (models.AllocationPool, error)

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

func (AllocationPoolController) DoesAllocationPoolExist

func (allocationPoolController AllocationPoolController) DoesAllocationPoolExist(name string) (int, bool)

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

func (*AllocationPoolController) GetByID

func (allocationPoolController *AllocationPoolController) GetByID(id int) (models.AllocationPool, error)

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

func (*AllocationPoolController) GetByName

func (allocationPoolController *AllocationPoolController) GetByName(name string) (models.AllocationPool, error)

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

func (*AllocationPoolController) ListAll

func (allocationPoolController *AllocationPoolController) ListAll() ([]models.AllocationPool, error)

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

Jump to

Keyboard shortcuts

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