backend

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 16 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 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 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