Documentation
¶
Index ¶
- func CreateDescribeComponentFunc(authManager auth.AuthManager) func(string, string) (map[string]any, error)
- func ExecuteProvisionCommand(cmd *cobra.Command, args []string, parser *flags.StandardParser, ...) error
- func GetBackendCommand() *cobra.Command
- func InitConfigAndAuth(component, stack, identity string) (*schema.AtmosConfiguration, *schema.AuthContext, error)
- func ResetDependencies()
- func SetAtmosConfig(config *schema.AtmosConfiguration)
- func SetConfigInitializer(ci ConfigInitializer)
- func SetProvisioner(p Provisioner)
- type CommonOptions
- type ConfigInitializer
- type CreateBackendParams
- type DeleteBackendParams
- type Provisioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDescribeComponentFunc ¶
func CreateDescribeComponentFunc(authManager auth.AuthManager) func(string, string) (map[string]any, error)
CreateDescribeComponentFunc creates a describe component function with the given authManager.
func ExecuteProvisionCommand ¶
func ExecuteProvisionCommand(cmd *cobra.Command, args []string, parser *flags.StandardParser, perfLabel string) error
ExecuteProvisionCommand is the shared RunE implementation for create and update commands. Both operations are idempotent - they provision or update the backend to match the desired state.
func GetBackendCommand ¶
GetBackendCommand returns the backend command for parent registration.
func InitConfigAndAuth ¶
func InitConfigAndAuth(component, stack, identity string) (*schema.AtmosConfiguration, *schema.AuthContext, error)
InitConfigAndAuth initializes Atmos configuration and optional authentication. Returns atmosConfig, authContext, and error. It loads component configuration, merges component-level auth with global auth, and creates an AuthContext that respects component's default identity settings.
func ResetDependencies ¶
func ResetDependencies()
ResetDependencies resets dependencies to production defaults (for test cleanup).
func SetAtmosConfig ¶
func SetAtmosConfig(config *schema.AtmosConfiguration)
SetAtmosConfig sets the Atmos configuration for the backend command. This is called from root.go after atmosConfig is initialized.
func SetConfigInitializer ¶
func SetConfigInitializer(ci ConfigInitializer)
SetConfigInitializer sets the config initializer (for testing). If nil is passed, resets to default implementation.
func SetProvisioner ¶
func SetProvisioner(p Provisioner)
SetProvisioner sets the provisioner (for testing). If nil is passed, resets to default implementation.
Types ¶
type CommonOptions ¶
CommonOptions contains the standard flags shared by all backend commands.
func ParseCommonFlags ¶
func ParseCommonFlags(cmd *cobra.Command, parser *flags.StandardParser) (*CommonOptions, error)
ParseCommonFlags parses common flags (stack, identity) using StandardParser with Viper precedence.
type ConfigInitializer ¶
type ConfigInitializer interface {
InitConfigAndAuth(component, stack, identity string) (*schema.AtmosConfiguration, *schema.AuthContext, error)
}
ConfigInitializer abstracts configuration and auth initialization for testability.
type CreateBackendParams ¶
type CreateBackendParams struct {
AtmosConfig *schema.AtmosConfiguration
Component string
Stack string
DescribeFunc func(string, string) (map[string]any, error)
AuthContext *schema.AuthContext
}
CreateBackendParams contains parameters for CreateBackend operation.
type DeleteBackendParams ¶
type DeleteBackendParams struct {
AtmosConfig *schema.AtmosConfiguration
Component string
Stack string
Force bool
DescribeFunc func(string, string) (map[string]any, error)
AuthContext *schema.AuthContext
}
DeleteBackendParams contains parameters for DeleteBackend operation.
type Provisioner ¶
type Provisioner interface {
CreateBackend(params *CreateBackendParams) error
DeleteBackend(params *DeleteBackendParams) error
DescribeBackend(atmosConfig *schema.AtmosConfiguration, component string, opts interface{}) error
ListBackends(atmosConfig *schema.AtmosConfiguration, opts interface{}) error
}
Provisioner abstracts provisioning operations for testability.