azure

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultLocation the default Azure region to be used.
	DefaultLocation = "eastus"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureEnv

type AzureEnv struct {
	*docker.DockerHelper
	// contains filtered or unexported fields
}

func New

func New(config *Config, opts ...ConfigOptFn) (*AzureEnv, error)

func (*AzureEnv) Context

func (e *AzureEnv) Context(ctx context.Context) (context.Context, error)

Context updates the provided ctx with environment specific data like with initialized client data allowing tests to interact with the underlying infrastructure.

func (*AzureEnv) Endpoints

func (e *AzureEnv) Endpoints(ctx context.Context) (*types.Endpoints, error)

Endpoints returns an Endpoints object containing API endpoints for services.

func (*AzureEnv) ServiceLogs

func (e *AzureEnv) ServiceLogs(ctx context.Context, services []string, startTime time.Time, stdout, stderr io.Writer) error

ServiceLogs writes service logs to io.Writer for list of services from startTime timestamp. Returns error if it cannot retrieve logs.

func (*AzureEnv) SetUp

func (e *AzureEnv) SetUp(ctx context.Context) error

SetUp Azure test environment * Install necessary components via the built bicep files. * Create test asset. * When infrastructure is ready, start SSH port forwarding and remote docker client. Returns error if it fails to set up the environment.

func (*AzureEnv) TearDown

func (e *AzureEnv) TearDown(ctx context.Context) error

TearDown the test environment by uninstalling components installed via Setup. Returns error if it fails to clean up the environment.

type Config

type Config struct {
	// EnvName the name of the environment to be created
	EnvName string `mapstructure:"env_name"`
	// WorkDir absolute path to the directory where the deployment files prior performing actions
	WorkDir string `mapstructure:"work_dir"`
	// Region the Azure region to be used
	Region string `mapstructure:"region"`
	// PublicKeyFile the public key file to be used for the key pair
	PublicKeyFile string `mapstructure:"public_key_file"`
	// PrivateKeyFile the private key file to be used for the key pair
	PrivateKeyFile string `mapstructure:"private_key_file"`
}

type ConfigOptFn

type ConfigOptFn func(*Config) error

ConfigOptFn defines transformer function for Config.

func WithWorkDir

func WithWorkDir(dir string) ConfigOptFn

WithWorkDir set workDir for Config.

type ContainerImages

type ContainerImages = envtypes.ContainerImages[string]

Jump to

Keyboard shortcuts

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