Documentation ¶
Overview ¶
Package locations is responsible for handling locations where deployments can take place
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequestError ¶
IsBadRequestError checks if an error is an error due to a bad input
func IsLocationAlreadyExistError ¶
IsLocationAlreadyExistError checks if an error is an "location already exists" error
func IsLocationNotFoundError ¶
IsLocationNotFoundError checks if an error is an "location not found" error
Types ¶
type LocationConfiguration ¶
type LocationConfiguration struct { Name string `yaml:"name" mapstructure:"name"` Type string `yaml:"type,omitempty" mapstructure:"type"` // not an enum as it could be extended by plugins Properties config.DynamicMap `yaml:"properties,omitempty" mapstructure:"properties"` }
LocationConfiguration holds a location configuration
type LocationsDefinition ¶
type LocationsDefinition struct {
Locations []LocationConfiguration `yaml:"locations" mapstructure:"locations" json:"locations"`
}
LocationsDefinition represents the structure of an initialization file defining locations
type Manager ¶
type Manager interface { InitializeLocations(locationFilePath string) (bool, error) CreateLocation(lConfig LocationConfiguration) error UpdateLocation(lConfig LocationConfiguration) error RemoveLocation(locationName string) error SetLocationConfiguration(lConfig LocationConfiguration) error GetLocations() ([]LocationConfiguration, error) GetLocationProperties(locationName, locationType string) (config.DynamicMap, error) GetLocationPropertiesForNode(ctx context.Context, deploymentID, nodeName, locationType string) (config.DynamicMap, error) GetPropertiesForFirstLocationOfType(locationType string) (config.DynamicMap, error) Cleanup() error }
A Manager is in charge of creating/updating/deleting locations from the pool
func GetManager ¶
func GetManager(cfg config.Configuration) (Manager, error)
GetManager gets a Location Manager, creating one if none was created yet
func NewManager ¶
func NewManager(client *api.Client, cfg config.Configuration) Manager
NewManager creates a Location Manager for the http server The http server has already a Consul client instance that was provided to it as a constructor input parameter (see rest.NewServer function).