Documentation
¶
Index ¶
- Variables
- func AliasedOrganizationSlug(ctx context.Context, inputSlug string) (string, error)
- func ClusterFromFlagOrSelect(ctx context.Context, orgSlug string) (*uiex.ManagedCluster, error)
- func GetAvailableMPGRegionCodes(ctx context.Context, orgSlug string) ([]string, error)
- func GetAvailableMPGRegions(ctx context.Context, orgSlug string) ([]fly.Region, error)
- func IsValidMPGRegion(ctx context.Context, orgSlug string, regionCode string) (bool, error)
- func New() *cobra.Command
- func ResolveOrganizationSlug(ctx context.Context, inputSlug string) (string, error)
- type CreateClusterParams
- type DefaultRegionProvider
- type MPGService
- func (s *MPGService) GetAvailableMPGRegionCodes(ctx context.Context, orgSlug string) ([]string, error)
- func (s *MPGService) GetAvailableMPGRegions(ctx context.Context, orgSlug string) ([]fly.Region, error)
- func (s *MPGService) IsValidMPGRegion(ctx context.Context, orgSlug string, regionCode string) (bool, error)
- type PlanDetails
- type RegionProvider
Constants ¶
This section is empty.
Variables ¶
var MPGPlans = map[string]PlanDetails{
"basic": {
Name: "Basic",
CPU: "Shared x 2",
Memory: "1 GB",
PricePerMo: 38,
},
"starter": {
Name: "Starter",
CPU: "Shared x 2",
Memory: "2 GB",
PricePerMo: 72,
},
"launch": {
Name: "Launch",
CPU: "Performance x 2",
Memory: "8 GB",
PricePerMo: 282,
},
"scale": {
Name: "Scale",
CPU: "Performance x 4",
Memory: "33 GB",
PricePerMo: 962,
},
}
Functions ¶
func AliasedOrganizationSlug ¶ added in v0.3.167
AliasedOrganizationSlug resolves organization slug the aliased slug using GraphQL.
Example:
Input: "jon-phenow" Output: "personal" (if "jon-phenow" is an alias for "personal")
GraphQL Query:
query { organization(slug: "jon-phenow"){ slug } }
Response:
{ "data": { "organization": { "slug": "personal" } } }
func ClusterFromFlagOrSelect ¶ added in v0.3.108
ClusterFromFlagOrSelect retrieves the cluster ID from the --cluster flag. If the flag is not set, it prompts the user to select a cluster from the available ones for the given organization.
func GetAvailableMPGRegionCodes ¶ added in v0.3.145
GetAvailableMPGRegionCodes returns just the region codes for error messages
func GetAvailableMPGRegions ¶ added in v0.3.145
GetAvailableMPGRegions returns the list of regions available for Managed Postgres
func IsValidMPGRegion ¶ added in v0.3.145
IsValidMPGRegion checks if a region code is valid for Managed Postgres
func ResolveOrganizationSlug ¶ added in v0.3.145
ResolveOrganizationSlug resolves organization slug aliases to the canonical slug using GraphQL. This handles cases where users use aliases that map to different canonical organization slugs.
Example:
Input: "personal" Output: "jon-phenow" (if "personal" is an alias for "jon-phenow")
GraphQL Query:
query { organization(slug: "personal"){ rawSlug } }
Response:
{ "data": { "organization": { "rawSlug": "jon-phenow" } } }
Types ¶
type CreateClusterParams ¶ added in v0.3.111
type DefaultRegionProvider ¶ added in v0.3.145
type DefaultRegionProvider struct{}
DefaultRegionProvider implements RegionProvider using the prompt package
func (*DefaultRegionProvider) GetPlatformRegions ¶ added in v0.3.145
type MPGService ¶ added in v0.3.145
type MPGService struct {
// contains filtered or unexported fields
}
MPGService provides MPG-related functionality with injectable dependencies
func NewMPGService ¶ added in v0.3.145
func NewMPGService(ctx context.Context) *MPGService
NewMPGService creates a new MPGService with default dependencies
func NewMPGServiceWithDependencies ¶ added in v0.3.145
func NewMPGServiceWithDependencies(uiexClient uiexutil.Client, regionProvider RegionProvider) *MPGService
NewMPGServiceWithDependencies creates a new MPGService with custom dependencies
func (*MPGService) GetAvailableMPGRegionCodes ¶ added in v0.3.145
func (s *MPGService) GetAvailableMPGRegionCodes(ctx context.Context, orgSlug string) ([]string, error)
GetAvailableMPGRegionCodes returns just the region codes for error messages
func (*MPGService) GetAvailableMPGRegions ¶ added in v0.3.145
func (s *MPGService) GetAvailableMPGRegions(ctx context.Context, orgSlug string) ([]fly.Region, error)
GetAvailableMPGRegions returns the list of regions available for Managed Postgres
func (*MPGService) IsValidMPGRegion ¶ added in v0.3.145
func (s *MPGService) IsValidMPGRegion(ctx context.Context, orgSlug string, regionCode string) (bool, error)
IsValidMPGRegion checks if a region code is valid for Managed Postgres
type PlanDetails ¶ added in v0.3.154
PlanDetails holds the details for each managed postgres plan.