stores

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListLayers added in v0.10.0

func ListLayers(rootDir string) error

func ListStacks added in v0.10.0

func ListStacks(rootDir string) error

Types

type ActionPlan

type ActionPlan struct {
	Tasks     []ActionTask                  `yaml:"actions"`
	Entities  map[string]any                `yaml:"entities"`
	Refs      []types.IK2TemplateRef        `yaml:"refs"`
	Templates map[string]*types.IK2Template `yaml:"-"`
	// contains filtered or unexported fields
}

func NewActionPlan

func NewActionPlan(inventory *Inventory) *ActionPlan

func (*ActionPlan) AddEntity

func (ap *ActionPlan) AddEntity(meta types.IK2Metadata, body any)

func (*ActionPlan) AddTask

func (ap *ActionPlan) AddTask(task ActionTask)

func (*ActionPlan) Apply

func (ap *ActionPlan) Apply() error

func (*ActionPlan) Dedup

func (ap *ActionPlan) Dedup()

func (*ActionPlan) Destroy

func (ap *ActionPlan) Destroy() error

func (*ActionPlan) GetEntityAsTemplate

func (ap *ActionPlan) GetEntityAsTemplate(id string) (*types.IK2Template, error)

func (*ActionPlan) GetEntityAsTemplateApply

func (ap *ActionPlan) GetEntityAsTemplateApply(id string) (*types.IK2TemplateApply, error)

type ActionTask

type ActionTask struct {
	Type   ActionTaskType         `yaml:"type"`
	Params map[string]interface{} `yaml:"params"`
}

type ActionTaskType

type ActionTaskType string
const (
	ActionTaskTypeLocalResolve ActionTaskType = "local-resolve"
	ActionTaskTypeGitResolve   ActionTaskType = "git-resolve"
	ActionTaskTypeApply        ActionTaskType = "apply"
)

type FileStore

type FileStore struct {
	// Path to the directory where the files are stored
	Dir string
	K2  []*types.IK2[any]
}

func NewFileStore

func NewFileStore(dir string) *FileStore

NewFileStore creates a new FileStore

func (*FileStore) GetAsInventory

func (fs *FileStore) GetAsInventory(key string) (*types.IK2Inventory, error)

func (*FileStore) GetAsTemplate

func (fs *FileStore) GetAsTemplate(key string) (*types.IK2Template, error)

func (*FileStore) GetAsTemplateApply

func (fs *FileStore) GetAsTemplateApply(key string) (*types.IK2TemplateApply, error)

func (*FileStore) GetKey

func (fs *FileStore) GetKey(key string) (*types.IK2[any], error)

func (*FileStore) Scan

func (fs *FileStore) Scan(patterns []string) ([]string, error)

type Inventory

type Inventory struct {
	InventoryDir string
	InventoryKey string
	// contains filtered or unexported fields
}

func NewInventory

func NewInventory(inventoryPath string) (*Inventory, error)

func (*Inventory) Apply

func (i *Inventory) Apply(plan *ActionPlan) error

func (*Inventory) Destroy

func (i *Inventory) Destroy(plan *ActionPlan) error

func (*Inventory) ListStacks added in v0.10.1

func (i *Inventory) ListStacks() ([]StackInfo, error)

func (*Inventory) Plan

func (i *Inventory) Plan() (*ActionPlan, error)

type StackInfo added in v0.10.1

type StackInfo struct {
	Name        string
	Description string
	LayerCount  int
}

type StackStore added in v0.10.0

type StackStore struct {
	RootDir    string
	StacksDir  string
	Name       string
	Definition *types.IK2Stack
	Debug      bool
}

func NewStackStore added in v0.10.0

func NewStackStore(rootDir string, stackName string, debug bool) (*StackStore, error)

func (*StackStore) Build added in v0.10.4

func (s *StackStore) Build(targetLayer string) error

func (*StackStore) Down added in v0.10.0

func (s *StackStore) Down() error

func (*StackStore) Exec added in v0.10.5

func (s *StackStore) Exec(verb string, args []string) error

func (*StackStore) Healthcheck added in v0.10.0

func (s *StackStore) Healthcheck() error

func (*StackStore) Logs added in v0.10.0

func (s *StackStore) Logs(targetLayer string) error

func (*StackStore) Restart added in v0.10.0

func (s *StackStore) Restart() error

func (*StackStore) Rm added in v0.10.5

func (s *StackStore) Rm() error

func (*StackStore) Run added in v0.10.0

func (s *StackStore) Run(targetLayer, verb string, args []string) error

func (*StackStore) Status added in v0.10.0

func (s *StackStore) Status() error

func (*StackStore) Up added in v0.10.0

func (s *StackStore) Up() error

func (*StackStore) Urls added in v0.10.0

func (s *StackStore) Urls() error

type TemplatingStore

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

func NewTemplatingStore

func NewTemplatingStore(plan *ActionPlan) *TemplatingStore

func (*TemplatingStore) ApplyTemplate

func (t *TemplatingStore) ApplyTemplate(templateApplyId string, templateHash string, produceGitIgnore bool) (bool, error)

func (*TemplatingStore) DestroyTemplate

func (t *TemplatingStore) DestroyTemplate(templateApplyId string) error

Jump to

Keyboard shortcuts

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