pool

package
v0.0.0-...-1b7c243 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

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")

	ErrInvalidConstraintType = errors.Errorf("invalid constraint type. Valid types are: %s", strings.Join(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 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 SetPoolConstraint

func SetPoolConstraint(c *PoolConstraint) error

Types

type AddPoolOptions

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

type Pool

type Pool struct {
	Name        string `bson:"_id"`
	Default     bool
	Provisioner string
	Builder     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 (*Pool) GetDefaultRouter

func (p *Pool) GetDefaultRouter() (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)

type PoolConstraint

type PoolConstraint struct {
	PoolExpr  string
	Field     string
	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
	Provisioner string
	Builder     string
}

Jump to

Keyboard shortcuts

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