locations

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 14 Imported by: 11

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

func IsBadRequestError(err error) bool

IsBadRequestError checks if an error is an error due to a bad input

func IsLocationAlreadyExistError

func IsLocationAlreadyExistError(err error) bool

IsLocationAlreadyExistError checks if an error is an "location already exists" error

func IsLocationNotFoundError

func IsLocationNotFoundError(err error) bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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