Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(project string, c *Config, pollInventoryHourly bool, enabledBackends []backends.BackendType, setInventory *backends.Inventory) (backends.Backend, error)
New creates and initializes a new multi-cloud backend instance with the specified configuration. This is the main entry point for creating backend instances that can manage resources across multiple cloud providers simultaneously.
The function automatically registers and initializes all available cloud backends (AWS, GCP, Docker) based on the enabledBackends parameter. It sets up inventory polling, credential management, and caching as specified in the configuration.
Parameters:
- project: The project name/identifier for resource organization and tagging
- c: Backend configuration containing credentials, settings, and options
- pollInventoryHourly: Whether to automatically refresh inventory every hour
- enabledBackends: List of backend types to enable (AWS, GCP, Docker, etc.)
- setInventory: Optional pre-populated inventory to use instead of discovering resources
Returns:
- backends.Backend: The initialized backend interface for managing cloud resources
- error: nil on success, or an error if initialization fails
Usage:
config := &backend.Config{
RootDir: "/path/to/aerolab",
Cache: true,
LogLevel: 4,
AerolabVersion: "8.0.0",
}
backend, err := backend.New("my-project", config, true,
[]backends.BackendType{backends.BackendTypeAWS, backends.BackendTypeGCP}, nil)
if err != nil {
log.Fatal(err)
}
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package backendtest provides reusable test doubles for the backends package: a FakeBackend (implementing backends.Backend), a FakeCloud (implementing backends.Cloud), inventory fixture builders, and a helper for registering a fake Cloud in the global registry with automatic cleanup.
|
Package backendtest provides reusable test doubles for the backends package: a FakeBackend (implementing backends.Backend), a FakeCloud (implementing backends.Cloud), inventory fixture builders, and a helper for registering a fake Cloud in the global registry with automatic cleanup. |
|
bgcp/iap
Package iap provides a thin adapter around github.com/cedws/iapc/iap that hides the third-party import behind aerolab-shaped types.
|
Package iap provides a thin adapter around github.com/cedws/iapc/iap that hides the third-party import behind aerolab-shaped types. |
|
sshkey
Package sshkey manages the SSH key pair that a project's instances are created with.
|
Package sshkey manages the SSH key pair that a project's instances are created with. |
Click to show internal directories.
Click to hide internal directories.