backend

package
v1.206.2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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

func GetBackendCommand() *cobra.Command

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

type CommonOptions struct {
	global.Flags
	Stack    string
	Identity string
}

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.

Jump to

Keyboard shortcuts

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