recipe

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Defaults = map[string][]byte{
	"minimal":         minimal,
	"satellite-core":  satelliteCore,
	"satellite-admin": satelliteAdmin,
	"db":              db,
	"postgres":        postgres,
	"edge":            edge,
	"tracing":         tracing,
	"billing":         billing,
	"gc":              gc,
	"ranged-loop":     rangedLoop,
	"uplink":          uplink,
	"repair":          repair,
	"audit":           audit,
}

Defaults is a map for recipes included in the binary.

Functions

This section is empty.

Types

type File

type File struct {
	Name string
	Path string
	Data string
}

File represents any configuration file required by a recipe.

type FlagModification

type FlagModification struct {
	Add    []string
	Remove []string
}

FlagModification represents modification for service command / flags.

type Folder

type Folder struct {
	Name string
	Path string
}

Folder represents any configuration folder required by a recipe.

type Matcher

type Matcher struct {
	Label []string
	Name  string
}

Matcher can identify the services to be modified by a recipe.

type Modification

type Modification struct {
	Match       Matcher
	Flag        FlagModification
	Config      map[string]string
	Environment map[string]string
}

Modification represents a transformation applied to one or more services.

type PortDefinition

type PortDefinition struct {
	Name        string
	Description string
	Target      int
	Protocol    string
}

PortDefinition gives information about used ports.

type Recipe

type Recipe struct {
	Name        string
	Description string
	Add         []*Service
	Modify      []*Modification
}

Recipe represents all configuration/runtime definition for a service.

func Read

func Read(data []byte) (Recipe, error)

Read loads a recipe from a yaml file.

type Service

type Service struct {
	Name          string
	ContainerName string
	Label         []string
	Instance      int
	Image         string
	Command       []string
	Environment   map[string]string
	Config        map[string]string
	Persistence   []string
	Port          []PortDefinition
	File          []File
	Folder        []Folder

	// port forward outside->inside
	PortForwards map[int]int

	// mount rules outside --> inside
	Mounts map[string]string
}

Service contains all the parameters to run one service.

func (Service) HasLabel

func (s Service) HasLabel(s2 string) bool

HasLabel checks if the service has one specific label.

type Stack

type Stack []Recipe

Stack is the list of known recipes.

func GetEmbeddedStack

func GetEmbeddedStack() (Stack, error)

GetEmbeddedStack returns with a stack includes only embedded recipes.

func GetStack

func GetStack() (Stack, error)

GetStack returns Stack with all the known recipe definitions.

func (Stack) AllRecipeNames

func (s Stack) AllRecipeNames() []string

AllRecipeNames returns with all internal recipe names.

func (Stack) FindRecipeByName

func (s Stack) FindRecipeByName(name string) (*Service, error)

FindRecipeByName returns with the recipe based on a name.

func (Stack) Get

func (s Stack) Get(name string) (Recipe, error)

Get returns with first recipe based on the the name.

Jump to

Keyboard shortcuts

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