Documentation ¶
Index ¶
- Constants
- Variables
- func DetectProjectAndStack(stackDir string) (project *Project, stack *Stack, err error)
- func FindProjectPath() (string, error)
- func FindProjectPathFrom(path string) (string, error)
- func FindStackPath() (string, error)
- func FindStackPathFrom(path string) (string, error)
- func IsProject(path string) bool
- func IsProjectFile(path string) bool
- func IsStack(path string) bool
- func IsStackFile(path string) bool
- type Project
- type ProjectConfiguration
- type Stack
- type StackConfiguration
Constants ¶
const ( StackFile = "stack.yaml" ProjectFile = "project.yaml" CiTestDir = "ci-test" SettingsFile = "settings.yaml" StdoutGoldenFile = "stdout.golden.yaml" KclFile = "kcl.yaml" )
Variables ¶
Functions ¶
func DetectProjectAndStack ¶
DetectProjectAndStack try to get stack and project from given path
func FindProjectPath ¶
FindProjectPath locates the closest project from the current working directory, or an error if not found.
func FindProjectPathFrom ¶
FindProjectPathFrom locates the closest project from the given path, searching "upwards" in the directory hierarchy. If no project is found, an empty path is returned.
func FindStackPath ¶
FindStackPath locates the closest stack from the current working directory, or an error if not found.
func FindStackPathFrom ¶
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 IsProjectFile ¶
IsProjectFile determine whether the given path is Project file
func IsStackFile ¶
IsStackFile determine whether the given path is Stack file
Types ¶
type Project ¶
type Project struct { ProjectConfiguration `json:",inline" yaml:",inline"` Path string `json:"path,omitempty" yaml:"path,omitempty"` // Absolute path to the project directory Stacks []*Stack `json:"stacks,omitempty" yaml:"stacks,omitempty"` // Stacks }
func FindAllProjects ¶
FindAllProjects find all projects from the current working directory
func FindAllProjectsFrom ¶
FindAllProjectsFrom find all project from the given path
func GetProject ¶
GetProject get project from the current working directory
func GetProjectFrom ¶
GetProjectFrom get project from the given path
func NewProject ¶
func NewProject(config *ProjectConfiguration, path string, stacks []*Stack) *Project
NewProject creates a new project
func (*Project) TableReport ¶
TableReport returns the report string of table format
type ProjectConfiguration ¶
type ProjectConfiguration struct { Name string `json:"name" yaml:"name"` // Project name Tenant string `json:"tenant,omitempty" yaml:"tenant,omitempty"` // Tenant name }
ProjectConfiguration is the project configuration
func ParseProjectConfiguration ¶
func ParseProjectConfiguration(path string) (*ProjectConfiguration, error)
ParseProjectConfiguration parse the project configuration by the given directory
type Stack ¶
type Stack struct { StackConfiguration `json:",inline" yaml:",inline"` Path string `json:"path,omitempty" yaml:"path,omitempty"` // Absolute path to the stack directory }
func FindAllStacks ¶
FindAllStacks find all stacks from the current working directory
func FindAllStacksFrom ¶
FindAllStacksFrom find all stacks from the given path
func GetStackFrom ¶
GetStackFrom get stack from the given path
func NewStack ¶
func NewStack(config *StackConfiguration, path string) *Stack
NewStack creates a new stack
func (*Stack) TableReport ¶
TableReport returns the report string of table format
type StackConfiguration ¶
type StackConfiguration struct {
Name string `json:"name" yaml:"name"` // Stack name
}
StackConfiguration is the stack configuration
func ParseStackConfiguration ¶
func ParseStackConfiguration(path string) (*StackConfiguration, error)
ParseStackConfiguration parse the stack configuration by the given directory