Documentation ¶
Overview ¶
This file was generated by go generate; DO NOT EDIT
Index ¶
- Constants
- Variables
- func NewDOFinder(acc *model.CloudAccount) (*digitalOceanRegionFinder, error)
- type AWSFinder
- type AzureFinder
- type GCEResourceFinder
- type Handler
- func (h *Handler) Create(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) Delete(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) Get(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAZs(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetRegions(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetTypes(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListAll(rw http.ResponseWriter, r *http.Request)
- func (h *Handler) Register(r *mux.Router)
- func (h *Handler) Update(rw http.ResponseWriter, r *http.Request)
- type MachineTypes
- type Region
- type RegionSizes
- type RegionsGetter
- type SKUSInterface
- type Service
- func (s *Service) Create(ctx context.Context, account *model.CloudAccount) error
- func (s *Service) Delete(ctx context.Context, accountName string) error
- func (s *Service) Get(ctx context.Context, accountName string) (*model.CloudAccount, error)
- func (s *Service) GetAll(ctx context.Context) ([]model.CloudAccount, error)
- func (s *Service) Update(ctx context.Context, account *model.CloudAccount) error
- type Size
- type SubscriptionsInterface
- type TypesGetter
- type VMType
- type ZonesGetter
Constants ¶
const DefaultStoragePrefix = "/supergiant/account/"
Variables ¶
var ( ErrNilAccount = errors.New("nil account") ErrUnsupportedProvider = errors.New("unsupported provider") VMResourceType = "virtualMachines" )
Functions ¶
func NewDOFinder ¶
func NewDOFinder(acc *model.CloudAccount) (*digitalOceanRegionFinder, error)
Types ¶
type AWSFinder ¶
type AWSFinder struct {
// contains filtered or unexported fields
}
func NewAWSFinder ¶
func (*AWSFinder) GetRegions ¶
func (af *AWSFinder) GetRegions(ctx context.Context) (*RegionSizes, error)
type AzureFinder ¶
type AzureFinder struct {
// contains filtered or unexported fields
}
func NewAzureFinder ¶
func NewAzureFinder(acc *model.CloudAccount, cfg *steps.Config) (*AzureFinder, error)
func (AzureFinder) GetRegions ¶
func (f AzureFinder) GetRegions(ctx context.Context) (*RegionSizes, error)
type GCEResourceFinder ¶
type GCEResourceFinder struct {
// contains filtered or unexported fields
}
func NewGCEFinder ¶
func NewGCEFinder(acc *model.CloudAccount, config *steps.Config) (*GCEResourceFinder, error)
func (*GCEResourceFinder) GetRegions ¶
func (g *GCEResourceFinder) GetRegions(ctx context.Context) (*RegionSizes, error)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a http controller for account entity
func NewHandler ¶
func (*Handler) Create ¶
func (h *Handler) Create(rw http.ResponseWriter, r *http.Request)
Create register new cloud account
func (*Handler) Delete ¶
func (h *Handler) Delete(rw http.ResponseWriter, r *http.Request)
Delete cloud account
func (*Handler) Get ¶
func (h *Handler) Get(rw http.ResponseWriter, r *http.Request)
Get retrieves individual account by name
func (*Handler) GetRegions ¶
func (h *Handler) GetRegions(w http.ResponseWriter, r *http.Request)
type MachineTypes ¶
type MachineTypes struct {
// contains filtered or unexported fields
}
func (MachineTypes) RegionTypes ¶
func (s MachineTypes) RegionTypes(region string) ([]string, error)
Region return a list of supported vm types in the region. Used by RegionFinders.
func (MachineTypes) Regions ¶
func (s MachineTypes) Regions() []string
Regions return a list of supported regions.
func (MachineTypes) Sizes ¶
func (s MachineTypes) Sizes() map[string]VMType
Sizes provides virtual machine parameters (cpu/ram/gpu). Used by RegionFinders.
type Region ¶
type Region struct { //Human readable name, e.g. New York City 1 or EU West 1 Frankfurt Name string `json:"name"` //API specific ID, e.g. t2.micro ID string `json:"id"` //API specific IDs for a node sizes/type AvailableSizes []string }
Region represents
type RegionSizes ¶
type RegionSizes struct { Provider clouds.Name `json:"provider"` Regions []*Region `json:"regions"` Sizes map[string]interface{} `json:"sizes"` }
RegionSizes represents aggregated information about available regions/azs and node sizes/types
type RegionsGetter ¶
type RegionsGetter interface { //GetRegions returns a slice of cloud specific regions/az's //if not found would return an empty slice GetRegions(context.Context) (*RegionSizes, error) }
RegionsGetter is used to find a list of available regions(availability zones, etc) with available vm types in a given cloud provider using given account credentials
func NewRegionsGetter ¶
func NewRegionsGetter(account *model.CloudAccount, config *steps.Config) (RegionsGetter, error)
NewRegionsGetter returns finder attached to corresponding account as it has all credentials for a cloud provider
type SKUSInterface ¶
type SKUSInterface interface {
ListComplete(ctx context.Context) (skus.ResourceSkusResultIterator, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds all business logic related to cloud accounts
type SubscriptionsInterface ¶
type SubscriptionsInterface interface {
ListLocations(ctx context.Context, subscriptionID string) (subscription.LocationListResult, error)
}
type TypesGetter ¶
func NewTypesGetter ¶
func NewTypesGetter(account *model.CloudAccount, config *steps.Config) (TypesGetter, error)
NewTypesGetter returns finder attached to corresponding account as it has all credentials for a cloud provider
type ZonesGetter ¶
func NewZonesGetter ¶
func NewZonesGetter(account *model.CloudAccount, config *steps.Config) (ZonesGetter, error)
NewZonesGetter returns finder attached to corresponding account as it has all credentials for a cloud provider