playbook

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name   string
	Values string
}

Config represents a set of kubernetes configuration. Usually, Values are expected to be yaml.

type ConfigRepository

type ConfigRepository interface {
	Save(namespace string, configs []Config) error
	Delete(namespace string) error
}

ConfigRepository represents a service that implements configs management

type ConfigService

type ConfigService interface {
	Generate(Inventory) error
	Delete(namespace string) error
}

ConfigService define the way configuration are managed

func NewConfigService

func NewConfigService(configs ConfigRepository, playbooks PlaybookService) ConfigService

NewConfigService creates a ConfigService

type ConfigTemplate

type ConfigTemplate struct {
	Name     string
	Template *template.Template
}

ConfigTemplate represents a set of kubernetes configuration template. Usually, Template is expected to be golang template of yaml.

type ErrorInventoryAlreadyExist

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

ErrorInventoryAlreadyExist represents an error due to an already existing inventory for a given namespace

func NewErrorInventoryAlreadyExist

func NewErrorInventoryAlreadyExist(namespace string) ErrorInventoryAlreadyExist

NewErrorInventoryAlreadyExist creates a new ErrorInventoryAlreadyExist error

func (ErrorInventoryAlreadyExist) Error

func (err ErrorInventoryAlreadyExist) Error() string

Error returns the error message

type ErrorInventoryNotFound

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

ErrorInventoryNotFound represents an error due to a missing inventory for the given namespace

func NewErrorInventoryNotFound

func NewErrorInventoryNotFound(namespace string) ErrorInventoryNotFound

NewErrorInventoryNotFound creates a new ErrorInventoryNotFound error

func (ErrorInventoryNotFound) Error

func (err ErrorInventoryNotFound) Error() string

Error returns the error message

type ErrorReadingDefaultsFile

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

ErrorReadingDefaultsFile represents an error due to unreadable default inventory

func NewErrorReadingDefaultsFile

func NewErrorReadingDefaultsFile(err error) ErrorReadingDefaultsFile

NewErrorReadingDefaultsFile creates an ErrorReadingDefaultsFile error

func (ErrorReadingDefaultsFile) Error

func (err ErrorReadingDefaultsFile) Error() string

Error returns the error message

type Inventory

type Inventory struct {
	Namespace string                 `json:"namespace"`
	Values    map[string]interface{} `json:"values"`
}

Inventory represents a set of variable to apply to the templates (see config). Namespace is the namespace dedicated files where to apply the variables contains into Values Values is map of string that contains whatever the user set in the default inventory from a playbook

type InventoryRelease

type InventoryRelease struct {
	Namespace string                 `json:"namespace"`
	Values    map[string]interface{} `json:"values"`
	Release   Release                `json:"release"`
}

InventoryRelease represents an inventory enriched with release data.

type InventoryRepository

type InventoryRepository interface {
	Get(namespace string) (Inventory, error)
	Exists(namespace string) bool
	Create(Inventory) error
	Delete(namespace string) error
	Update(namespace string, inventory Inventory) error
	List() ([]Inventory, error)
}

InventoryRepository define the way inventories are actually managed

type InventoryService

type InventoryService interface {
	Create(namespace string) (Inventory, error)
	Update(namespace string, inventory Inventory) error
	Get(namespace string) (Inventory, error)
	Exists(namespace string) bool
	List() ([]Inventory, error)
	Delete(namespace string) error
	Reset(namespace string) (Inventory, error)
}

InventoryService define the way inventories are managed.

func NewInventoryService

func NewInventoryService(inventories InventoryRepository, playbooks PlaybookService) InventoryService

NewInventoryService create an InventoryService

type PlaybookRepository

type PlaybookRepository interface {
	GetDefault() (Inventory, error)
	GetTemplate() ([]ConfigTemplate, error)
}

PlaybookRepository is an actual implementation of playbook management

type PlaybookService

type PlaybookService interface {
	GetDefault() (Inventory, error)
	GetTemplate() ([]ConfigTemplate, error)
}

PlaybookService represents the way playbook are managed

func NewPlaybookService

func NewPlaybookService(playbooks PlaybookRepository) PlaybookService

NewPlaybookService returns a new PlaybookService

type Release

type Release struct {
	Date string `json:"date"`
}

Release represents information related to an inventory release. An inventory may evolve with time. We want to keep trace of those evolution and we may inject data specific a release in the templates

Jump to

Keyboard shortcuts

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