stack

package
v0.9.1-rc Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const File = "stack.yaml"

Variables

View Source
var (
	ErrNotStackDirectory = errors.New("path must be a stack directory")
	ErrStackNotUnique    = errors.New("the stack obtained is not unique")
)

Functions

func FindStackPath

func FindStackPath() (string, error)

FindStackPath locates the closest stack from the current working directory, or an error if not found.

func FindStackPathFrom

func FindStackPathFrom(path string) (string, error)

FindStackPathFrom locates the closest stack from the given path, searching "upwards" in the directory hierarchy. If no stack is found, an empty path is returned.

func IsStack

func IsStack(path string) bool

IsStack determine whether the given path is Stack directory

func IsStackFile

func IsStackFile(path string) bool

IsStackFile determine whether the given path is Stack file

Types

type Configuration

type Configuration struct {
	Name       string `json:"name" yaml:"name"`             // Stack name
	KubeConfig string `json:"kubeConfig" yaml:"kubeConfig"` // KubeConfig file path for this stack
}

Configuration is the stack configuration

func ParseStackConfiguration

func ParseStackConfiguration(path string) (*Configuration, error)

ParseStackConfiguration parse the stack configuration by the given directory

type Stack

type Stack struct {
	Configuration `json:",inline" yaml:",inline"`
	Path          string `json:"path,omitempty" yaml:"path,omitempty"` // Absolute path to the stack directory
}

func FindAllStacks

func FindAllStacks() ([]*Stack, error)

FindAllStacks find all stacks from the current working directory

func FindAllStacksFrom

func FindAllStacksFrom(path string) ([]*Stack, error)

FindAllStacksFrom find all stacks from the given path

func GetStack

func GetStack() (*Stack, error)

GetStack get stack from the current working directory

func GetStackFrom

func GetStackFrom(path string) (*Stack, error)

GetStackFrom get stack from the given path

func NewStack

func NewStack(config *Configuration, path string) *Stack

NewStack creates a new stack

func (*Stack) GetName

func (s *Stack) GetName() string

GetName returns the name of the stack

func (*Stack) GetPath

func (s *Stack) GetPath() string

GetPath returns the path of the stack

func (*Stack) TableReport

func (s *Stack) TableReport() string

TableReport returns the report string of table format

Jump to

Keyboard shortcuts

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