mpg

package
v0.5.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MPGPlans = map[string]PlanDetails{

	"dev-256": {
		Name:       "Developer",
		CPU:        "Shared x 1",
		Memory:     "256 MB",
		PricePerMo: 4,
	},
	"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:     "32 GB",
		PricePerMo: 962,
	},
	"Performance": {
		Name:       "Performance",
		CPU:        "Performance x 8",
		Memory:     "64 GB",
		PricePerMo: 1922,
	},
}

Functions

func AliasedOrganizationSlug added in v0.3.167

func AliasedOrganizationSlug(ctx context.Context, inputSlug string) (string, error)

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 ClusterFromArgOrSelect added in v0.3.209

func ClusterFromArgOrSelect(ctx context.Context, clusterID, orgSlug string) (*mpg.Cluster, string, error)

ClusterFromArgOrSelect retrieves the cluster if the cluster ID is passed in otherwise it prompts the user to select a cluster from the available ones for the given organization. It prompts for the org if the org slug is not provided.

func ClusterFromFlagOrSelect added in v0.3.108

func ClusterFromFlagOrSelect(ctx context.Context, orgSlug string) (*mpg.Cluster, error)

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 FormatAttachedApps added in v0.4.49

func FormatAttachedApps(apps []mpg.AttachedApp) string

FormatAttachedApps formats the list of attached apps for display

func New

func New() *cobra.Command

func ResolveOrganizationSlug added in v0.3.145

func ResolveOrganizationSlug(ctx context.Context, inputSlug string) (string, error)

ResolveOrganizationSlug resolves organization slug aliases to the canonical slug using the ui-ex API. 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 PlanDetails added in v0.3.154

type PlanDetails struct {
	Name       string
	CPU        string
	Memory     string
	PricePerMo int
}

PlanDetails holds the details for each managed postgres plan.

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL