pool

package
v0.0.0-...-9451de5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConstraintTypeTeam    = poolConstraintType("team")
	ConstraintTypeRouter  = poolConstraintType("router")
	ConstraintTypeService = poolConstraintType("service")
	ConstraintTypePlan    = poolConstraintType("plan")
)

Variables

View Source
var (
	ErrPublicDefaultPoolCantHaveTeams = errors.New("Public/Default pool can't have teams.")
	ErrDefaultPoolAlreadyExists       = errors.New("Default pool already exists.")
	ErrPoolNameIsRequired             = errors.New("Pool name is required.")
	ErrPoolNotFound                   = errors.New("Pool does not exist.")
	ErrPoolAlreadyExists              = errors.New("Pool already exists.")
	ErrPoolHasNoTeam                  = errors.New("no team found for pool")
	ErrPoolHasNoRouter                = errors.New("no router found for pool")
	ErrPoolHasNoService               = errors.New("no service found for pool")
	ErrPoolHasNoPlan                  = errors.New("no plan found for pool")
)
View Source
var (
	ErrInvalidConstraintType = errors.Errorf("invalid constraint type. Valid types are: %s", validConstraintTypes)
)

Functions

func AddPool

func AddPool(opts AddPoolOptions) error

func AddTeamsToPool

func AddTeamsToPool(poolName string, teams []string) error

func AppendPoolConstraint

func AppendPoolConstraint(c *PoolConstraint) error

func GetProvisionerForPool

func GetProvisionerForPool(name string) (provision.Provisioner, error)

func MigratePoolTeamsToPoolConstraints

func MigratePoolTeamsToPoolConstraints() error

func PoolUpdate

func PoolUpdate(name string, opts UpdatePoolOptions) error

func RemovePool

func RemovePool(poolName string) error

func RemoveTeamsFromPool

func RemoveTeamsFromPool(poolName string, teams []string) error

func RenamePoolTeam

func RenamePoolTeam(oldName, newName string) error

func ResetCache

func ResetCache()

func SetPoolConstraint

func SetPoolConstraint(c *PoolConstraint) error

func ToConstraintType

func ToConstraintType(value string) (poolConstraintType, error)

Types

type AddPoolOptions

type AddPoolOptions struct {
	Name        string
	Public      bool
	Default     bool
	Force       bool
	Provisioner string
}

type Pool

type Pool struct {
	Name        string `bson:"_id"`
	Default     bool
	Provisioner string
}

func GetDefaultPool

func GetDefaultPool() (*Pool, error)

func GetPoolByName

func GetPoolByName(name string) (*Pool, error)

GetPoolByName finds a pool by name

func ListAllPools

func ListAllPools() ([]Pool, error)

func ListPools

func ListPools(names ...string) ([]Pool, error)

func ListPoolsForTeam

func ListPoolsForTeam(team string) ([]Pool, error)

func ListPossiblePools

func ListPossiblePools(teams []string) ([]Pool, error)

func ListPublicPools

func ListPublicPools() ([]Pool, error)

func (*Pool) GetDefaultRouter

func (p *Pool) GetDefaultRouter() (string, error)

func (*Pool) GetPlans

func (p *Pool) GetPlans() ([]string, error)

func (*Pool) GetProvisioner

func (p *Pool) GetProvisioner() (provision.Provisioner, error)

func (*Pool) GetRouters

func (p *Pool) GetRouters() ([]string, error)

func (*Pool) GetServices

func (p *Pool) GetServices() ([]string, error)

func (*Pool) GetTeams

func (p *Pool) GetTeams() ([]string, error)

func (*Pool) MarshalJSON

func (p *Pool) MarshalJSON() ([]byte, error)

func (*Pool) ValidateRouters

func (p *Pool) ValidateRouters(routers []appTypes.AppRouter) error

type PoolConstraint

type PoolConstraint struct {
	PoolExpr  string
	Field     poolConstraintType
	Values    []string
	Blacklist bool
}

func ListPoolsConstraints

func ListPoolsConstraints(query bson.M) ([]*PoolConstraint, error)

func (*PoolConstraint) AllowsAll

func (c *PoolConstraint) AllowsAll() bool

type UpdatePoolOptions

type UpdatePoolOptions struct {
	Default *bool
	Public  *bool
	Force   bool
}

Jump to

Keyboard shortcuts

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