Documentation ¶
Index ¶
- Constants
- Variables
- func NewDOFinder(acc *model.CloudAccount) (*digitalOceanRegionFinder, error)
- type AWSFinder
- 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 Region
- type RegionSizes
- type RegionsGetter
- 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 TypesGetter
- type ZonesGetter
Constants ¶
const DefaultStoragePrefix = "/supergiant/account/"
Variables ¶
var ( ErrNilAccount = errors.New("nil account") ErrUnsupportedProvider = errors.New("unsupported provider") )
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 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 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 Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds all business logic related to cloud accounts
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