Documentation
¶
Index ¶
- Constants
- Variables
- func AddCommonListFlags(cmd *cobra.Command)
- func ExecuteListInstancesCmd(info *schema.ConfigAndStacksInfo, cmd *cobra.Command, args []string) error
- func FilterAndListComponents(stackFlag string, stacksMap map[string]any) ([]string, error)
- func FilterAndListStacks(stacksMap map[string]any, component string) ([]string, error)
- func FilterAndListValues(stacksMap map[string]interface{}, options *FilterOptions) (string, error)
- func FilterAndListVendor(atmosConfig *schema.AtmosConfiguration, options *FilterOptions) (string, error)
- func FilterAndListWorkflows(fileFlag string, listConfig schema.ListConfig, format string, delimiter string) (string, error)
- func ValidateFormat(format string) error
- func ValidateValuesFormat(formatStr string) error
- type CommonListFlags
- type FilterOptions
- type QueryParams
- type VendorInfo
Constants ¶
const ( // KeyTerraform is the key for terraform components. KeyTerraform = "terraform" // KeyHelmfile is the key for helmfile components. KeyHelmfile = "helmfile" // KeySettings is the key for settings section. KeySettings = "settings" // KeyMetadata is the key for metadata section. KeyMetadata = "metadata" // KeyComponents is the key for components section. KeyComponents = "components" // KeyVars is the key for vars section in components. KeyVars = "vars" // KeyAbstract is the key for abstract flag in components. KeyAbstract = "abstract" // KeyStack is the key used in log messages to identify stack contexts. KeyStack = "stack" // KeyComponent is the key used to identify component in log messages and errors. KeyComponent = "component" // DotChar is the dot character used in queries. DotChar = "." // LeftBracketChar is the left bracket character used in array indices. LeftBracketChar = "[" // KeyValue is the key used for scalar values in result maps. KeyValue = "value" // KeyQuery is the key used for query information in log messages and errors. KeyQuery = "query" // TypeFormatSpec is the format specifier used to print variable types. TypeFormatSpec = "%T" // KeyPattern is the key used in log messages for pattern matching contexts. KeyPattern = "pattern" )
Component and section name constants.
const ( // ColumnNameComponent is the column name for component. ColumnNameComponent = "Component" // ColumnNameType is the column name for type. ColumnNameType = "Type" // ColumnNameManifest is the column name for manifest. ColumnNameManifest = "Manifest" // ColumnNameFolder is the column name for folder. ColumnNameFolder = "Folder" // VendorTypeComponent is the type for components with component manifests. VendorTypeComponent = "Component Manifest" // VendorTypeVendor is the type for vendor manifests. VendorTypeVendor = "Vendor Manifest" // TemplateKeyComponent is the template key for component name. TemplateKeyComponent = "atmos_component" // TemplateKeyVendorType is the template key for vendor type. TemplateKeyVendorType = "atmos_vendor_type" // TemplateKeyVendorFile is the template key for vendor file. TemplateKeyVendorFile = "atmos_vendor_file" // TemplateKeyVendorTarget is the template key for vendor target. TemplateKeyVendorTarget = "atmos_vendor_target" // MaxManifestSearchDepth is the maximum directory depth to search for component manifests. MaxManifestSearchDepth = 10 )
const ( // NewLine is the newline character. NewLine = "\n" // DefaultTerminalWidth is the default terminal width. DefaultTerminalWidth = 80 // MaxColumnWidth is the maximum width for a column. MaxColumnWidth = 30 )
const ( FormatTable = "table" FormatJSON = "json" FormatYAML = "yaml" FormatCSV = "csv" FormatTSV = "tsv" )
const DefaultMaxColumns = 10
DefaultMaxColumns is the default maximum number of columns to display.
Variables ¶
var ( ErrInvalidStackPattern = errors.New("invalid stack pattern") ErrEmptyTargetComponentName = errors.New("target component name cannot be empty") ErrComponentsSectionNotFound = errors.New("components section not found in stack") ErrComponentNotFoundInSections = errors.New("component not found in terraform or helmfile sections") ErrQueryFailed = errors.New("query execution failed") )
Error variables for list_values package.
var ( // ErrNoVendorConfigsFound is returned when no vendor configurations are found. ErrNoVendorConfigsFound = errors.New("no vendor configurations found") // ErrVendorBasepathNotSet is returned when vendor.base_path is not set in atmos.yaml. ErrVendorBasepathNotSet = errors.New("vendor.base_path not set in atmos.yaml") // ErrVendorBasepathNotExist is returned when vendor.base_path does not exist. ErrVendorBasepathNotExist = errors.New("vendor base path does not exist") // ErrComponentManifestInvalid is returned when a component manifest is invalid. ErrComponentManifestInvalid = errors.New("invalid component manifest") // ErrVendorManifestInvalid is returned when a vendor manifest is invalid. ErrVendorManifestInvalid = errors.New("invalid vendor manifest") // ErrComponentManifestNotFound is returned when a component manifest is not found. ErrComponentManifestNotFound = errors.New("component manifest not found") )
var ( // ErrUnsupportedFormat is returned when an unsupported format is specified. ErrUnsupportedFormat = errors.New("unsupported format") // ErrInvalidVendorData is returned when vendor data is invalid. ErrInvalidVendorData = errors.New("invalid vendor data") )
Functions ¶
func AddCommonListFlags ¶ added in v1.170.0
AddCommonListFlags adds the common flags to a command.
func ExecuteListInstancesCmd ¶ added in v1.192.0
func ExecuteListInstancesCmd(info *schema.ConfigAndStacksInfo, cmd *cobra.Command, args []string) error
ExecuteListInstancesCmd executes the list instances command.
func FilterAndListComponents ¶
FilterAndListComponents filters and lists components based on the given stack.
func FilterAndListStacks ¶
FilterAndListStacks filters stacks by the given component
func FilterAndListValues ¶ added in v1.170.0
func FilterAndListValues(stacksMap map[string]interface{}, options *FilterOptions) (string, error)
FilterAndListValues filters and lists component values across stacks.
func FilterAndListVendor ¶ added in v1.176.0
func FilterAndListVendor(atmosConfig *schema.AtmosConfiguration, options *FilterOptions) (string, error)
FilterAndListVendor filters and lists vendor configurations using the internal formatter abstraction.
func FilterAndListWorkflows ¶ added in v1.155.0
func FilterAndListWorkflows(fileFlag string, listConfig schema.ListConfig, format string, delimiter string) (string, error)
FilterAndListWorkflows filters and lists workflows based on the given file
func ValidateFormat ¶ added in v1.155.0
ValidateFormat checks if the given format is supported.
func ValidateValuesFormat ¶ added in v1.170.0
ValidateFormat validates the output format.
Types ¶
type CommonListFlags ¶ added in v1.170.0
type CommonListFlags struct {
Query string
MaxColumns int
Format string
Delimiter string
Stack string
}
CommonListFlags represents the common flags used across list commands.
func GetCommonListFlags ¶ added in v1.170.0
func GetCommonListFlags(cmd *cobra.Command) (*CommonListFlags, error)
GetCommonListFlags extracts the common flags from a command.
type FilterOptions ¶ added in v1.170.0
type FilterOptions struct {
Component string
ComponentFilter string
Query string
IncludeAbstract bool
MaxColumns int
FormatStr string
Delimiter string
StackPattern string
}
FilterOptions contains the options for filtering and listing component values.