Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("cloud: not implemented")
ErrNotImplemented is the error returned if a method is not implemented.
Functions ¶
func Register ¶
func Register(name ProviderName, factory Factory)
Register registers a cloud provider factory by name.
The cloud MUST have a name: lower case and one word.
Types ¶
type Compute ¶ added in v0.0.16
type Compute interface { // DescribeRegions returns a list of regions. DescribeRegions(ctx context.Context) ([]*Region, error) // DescribeZones returns a list of availability zones within a region. DescribeZones(ctx context.Context) ([]*Zone, error) // DescribeVPCs returns a list of VPCs within a region. DescribeVPCs(ctx context.Context) ([]*VPC, error) // DescribeSubnets returns a list of subnets within a VPC. DescribeSubnets(ctx context.Context, vpcID string) ([]*Subnet, error) // DescribeInstances returns a list of instances. DescribeInstances(ctx context.Context, filters ...*Filter) ([]*Instance, error) }
Compute defines the interface of the Compute Services API.
type Factory ¶
type Factory func(options ...ProviderOption) (Provider, error)
Factory is a function that returns a Provider interface. An error is returned if the cloud provider fails to initialize, nil otherwise.
func GetFactory ¶
func GetFactory(name ProviderName) (Factory, error)
GetFactory returns a factory of cloud provider by name.
type Filter ¶ added in v0.0.16
Filter represents a name and value pair that is used to return a more specific list of results from a describe operation.
type IAM ¶ added in v0.0.16
type IAM interface { // GetInstanceProfile returns an instance profile by name. GetInstanceProfile(ctx context.Context, profileName string) (*InstanceProfile, error) // AttachRolePolicy attaches the specified policy to the specified IAM role. AttachRolePolicy(ctx context.Context, roleName, policyARN string) error }
type Instance ¶ added in v0.0.16
type Instance struct { ID string Name string InstanceProfile *InstanceProfile }
Describes an instance.
type InstanceProfile ¶ added in v0.0.16
Describes an IAM instance profile.
type Provider ¶ added in v0.0.16
type Provider interface { // Name returns the cloud provider name. Name() ProviderName // TODO(liran): Remove. Session(region, profile string) (interface{}, error) // Compute returns an instance of Compute interface. Compute() Compute // Storage returns an instance of Storage interface. Storage() Storage // IAM returns an instance of IAM interface. IAM() IAM }
Interface defines the interface that should be implemented by a cloud provider.
func GetInstance ¶
func GetInstance(name ProviderName, options ...ProviderOption) (Provider, error)
GetInstance returns an instance of cloud provider by name.
type ProviderOption ¶ added in v0.0.10
type ProviderOption func(*ProviderOptions)
ProviderOption allows specifying various settings configurable by the provider.
func WithProfile ¶ added in v0.0.10
func WithProfile(profile string) ProviderOption
WithProfile specifies credentials profile to use.
func WithRegion ¶ added in v0.0.10
func WithRegion(region string) ProviderOption
WithRegion specifies the region to use.
type ProviderOptions ¶ added in v0.0.10
type ProviderOptions struct { // Credentials profile. Profile string // Region name. Region string // DryRun configures the provider to print the actions that would be executed, // without executing them. DryRun bool }
func DefaultProviderOptions ¶ added in v0.0.10
func DefaultProviderOptions() *ProviderOptions
DefaultProviderOptions returns the default provider options.
type Storage ¶ added in v0.0.16
type Storage interface { // GetBucket returns a bucket by name. GetBucket(ctx context.Context, bucket string) (*Bucket, error) // CreateBucket creates a new bucket. CreateBucket(ctx context.Context, bucket string) (*Bucket, error) }
Storage defines the interface of the Storage Services API.