uiex

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachedApp added in v0.4.2

type AttachedApp struct {
	Name string `json:"name"`
	Id   int64  `json:"id"`
}

type BillingStatus added in v0.3.214

type BillingStatus string
const (
	BillingStatusCurrent        BillingStatus = "CURRENT"
	BillingStatusDelinquent     BillingStatus = "DELINQUENT"
	BillingStatusPastDue        BillingStatus = "PAST_DUE"
	BillingStatusSourceRequired BillingStatus = "SOURCE_REQUIRED"
	BillingStatusSuspended      BillingStatus = "SUSPENDED"
	BillingStatusTrialActive    BillingStatus = "TRIAL_ACTIVE"
	BillingStatusTrialEnded     BillingStatus = "TRIAL_ENDED"
)

type BuildFinalImage added in v0.3.214

type BuildFinalImage struct {
	Id        string `json:"id"`
	SizeBytes int64  `json:"size_bytes"`
	Tag       string `json:"tag"`
}

type BuildResponse added in v0.3.214

type BuildResponse struct {
	Id              int64  `json:"id"`
	Status          string `json:"status"`
	WallclockTimeMs int    `json:"wallclock_time_ms"`
}

type BuildStrategyAttempt added in v0.3.214

type BuildStrategyAttempt struct {
	Error    string `json:"error"`
	Note     string `json:"note"`
	Result   string `json:"result"`
	Strategy string `json:"strategy"`
}

type BuildTimings added in v0.3.214

type BuildTimings struct {
	BuildAndPushMs int64 `json:"build_and_push_ms"`
	BuildMs        int64 `json:"build_ms"`
	BuilderInitMs  int64 `json:"builder_init_ms"`
	ContextBuildMs int64 `json:"context_build_ms"`
	ImageBuildMs   int64 `json:"image_build_ms"`
	PushMs         int64 `json:"push_ms"`
}

type BuilderMeta added in v0.3.214

type BuilderMeta struct {
	BuilderType     string `json:"builder_type"`
	BuildkitEnabled bool   `json:"buildkit_enabled"`
	DockerVersion   string `json:"docker_version"`
	Platform        string `json:"platform"`
	RemoteAppName   string `json:"remote_app_name"`
	RemoteMachineId string `json:"remote_machine_id"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewWithOptions

func NewWithOptions(ctx context.Context, opts NewClientOpts) (*Client, error)

func (*Client) CreateAttachment added in v0.4.2

func (c *Client) CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)

CreateAttachment creates a ManagedServiceAttachment record linking an app to a managed Postgres cluster

func (*Client) CreateBuild added in v0.3.214

func (c *Client) CreateBuild(ctx context.Context, in CreateBuildRequest) (*BuildResponse, error)

func (*Client) CreateCluster added in v0.3.111

func (c *Client) CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)

func (*Client) CreateDatabase added in v0.3.210

func (c *Client) CreateDatabase(ctx context.Context, id string, input CreateDatabaseInput) (CreateDatabaseResponse, error)

func (*Client) CreateFlyManagedBuilder added in v0.3.149

func (c *Client) CreateFlyManagedBuilder(ctx context.Context, orgSlug string, region string) (CreateFlyManagedBuilderResponse, error)

func (*Client) CreateManagedClusterBackup added in v0.3.198

func (c *Client) CreateManagedClusterBackup(ctx context.Context, clusterID string, input CreateManagedClusterBackupInput) (CreateManagedClusterBackupResponse, error)

CreateManagedClusterBackup creates a new backup for a managed Postgres cluster

func (*Client) CreateRelease added in v0.3.214

func (c *Client) CreateRelease(ctx context.Context, request CreateReleaseRequest) (release *Release, err error)

func (*Client) CreateUser added in v0.3.99

func (c *Client) CreateUser(ctx context.Context, id string, input CreateUserInput) (CreateUserResponse, error)

func (*Client) CreateUserWithRole added in v0.3.211

func (c *Client) CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)

func (*Client) DeleteAttachment added in v0.4.2

func (c *Client) DeleteAttachment(ctx context.Context, clusterId string, appName string) (DeleteAttachmentResponse, error)

DeleteAttachment removes a ManagedServiceAttachment record linking an app to a managed Postgres cluster

func (*Client) DeleteUser added in v0.3.211

func (c *Client) DeleteUser(ctx context.Context, id string, username string) error

func (*Client) DestroyCluster added in v0.3.145

func (c *Client) DestroyCluster(ctx context.Context, orgSlug string, id string) error

DestroyCluster permanently destroys a managed Postgres cluster

func (*Client) EnsureDepotBuilder added in v0.3.214

func (*Client) FinishBuild added in v0.3.214

func (c *Client) FinishBuild(ctx context.Context, in FinishBuildRequest) (*BuildResponse, error)

func (*Client) GetAllAppsCurrentReleaseTimestamps added in v0.3.214

func (c *Client) GetAllAppsCurrentReleaseTimestamps(ctx context.Context) (out *map[string]time.Time, err error)

func (*Client) GetCurrentRelease added in v0.3.214

func (c *Client) GetCurrentRelease(ctx context.Context, appName string) (release *Release, err error)

GetCurrentRelease retrieves the current release for an app. Returns nil release (without error) if the app has no current release (404).

func (*Client) GetManagedCluster

func (c *Client) GetManagedCluster(ctx context.Context, orgSlug string, id string) (GetManagedClusterResponse, error)

func (*Client) GetManagedClusterById added in v0.3.99

func (c *Client) GetManagedClusterById(ctx context.Context, id string) (GetManagedClusterResponse, error)

func (*Client) GetOrganization added in v0.3.214

func (c *Client) GetOrganization(ctx context.Context, orgSlug string) (*Organization, error)

func (*Client) GetUserCredentials added in v0.3.211

func (c *Client) GetUserCredentials(ctx context.Context, id string, username string) (GetUserCredentialsResponse, error)

func (*Client) ListDatabases added in v0.3.210

func (c *Client) ListDatabases(ctx context.Context, id string) (ListDatabasesResponse, error)

func (*Client) ListMPGRegions added in v0.3.145

func (c *Client) ListMPGRegions(ctx context.Context, orgSlug string) (ListMPGRegionsResponse, error)

ListMPGRegions returns the list of regions available for Managed Postgres TODO: Implement the actual API endpoint on the backend

func (*Client) ListManagedClusterBackups added in v0.3.198

func (c *Client) ListManagedClusterBackups(ctx context.Context, clusterID string) (ListManagedClusterBackupsResponse, error)

ListManagedClusterBackups returns the list of backups for a managed Postgres cluster

func (*Client) ListManagedClusters

func (c *Client) ListManagedClusters(ctx context.Context, orgSlug string, deleted bool) (ListManagedClustersResponse, error)

func (*Client) ListOrganizations added in v0.3.214

func (c *Client) ListOrganizations(ctx context.Context, admin bool) ([]Organization, error)

func (*Client) ListReleases added in v0.3.214

func (c *Client) ListReleases(ctx context.Context, appName string, limit int) ([]Release, error)

func (*Client) ListUsers added in v0.3.211

func (c *Client) ListUsers(ctx context.Context, id string) (ListUsersResponse, error)

func (*Client) RestoreManagedClusterBackup added in v0.3.198

func (c *Client) RestoreManagedClusterBackup(ctx context.Context, clusterID string, input RestoreManagedClusterBackupInput) (RestoreManagedClusterBackupResponse, error)

RestoreManagedClusterBackup restores a managed Postgres cluster from a backup

func (*Client) UpdateRelease added in v0.3.214

func (c *Client) UpdateRelease(ctx context.Context, releaseID, status string, metadata any) (response *Release, err error)

func (*Client) UpdateUserRole added in v0.3.211

func (c *Client) UpdateUserRole(ctx context.Context, id string, username string, input UpdateUserRoleInput) (UpdateUserRoleResponse, error)

type CreateAttachmentInput added in v0.4.2

type CreateAttachmentInput struct {
	AppName string `json:"app_name"`
}

type CreateAttachmentResponse added in v0.4.2

type CreateAttachmentResponse struct {
	Data struct {
		Id               int64  `json:"id"`
		AppId            int64  `json:"app_id"`
		ManagedServiceId int64  `json:"managed_service_id"`
		AttachedAt       string `json:"attached_at"`
	} `json:"data"`
}

type CreateBuildRequest added in v0.3.214

type CreateBuildRequest struct {
	AppName             string   `json:"app_name,omitempty"`
	BuilderType         string   `json:"builder_type,omitempty"`
	MachineId           string   `json:"machine_id,omitempty"`
	StrategiesAvailable []string `json:"strategies_available,omitempty"`
}

type CreateClusterInput added in v0.3.111

type CreateClusterInput struct {
	Name           string `json:"name"`
	Region         string `json:"region"`
	Plan           string `json:"plan"`
	OrgSlug        string `json:"org_slug"`
	Disk           int    `json:"disk"`
	PostGISEnabled bool   `json:"postgis_enabled"`
	PGMajorVersion string `json:"pg_major_version"`
}

type CreateClusterResponse added in v0.3.111

type CreateClusterResponse struct {
	Ok     bool           `json:"ok"`
	Errors DetailedErrors `json:"errors"`
	Data   struct {
		Id             string                      `json:"id"`
		Name           string                      `json:"name"`
		Status         *string                     `json:"status"`
		Plan           string                      `json:"plan"`
		Environment    *string                     `json:"environment"`
		Region         string                      `json:"region"`
		Organization   fly.Organization            `json:"organization"`
		Replicas       int                         `json:"replicas"`
		Disk           int                         `json:"disk"`
		IpAssignments  ManagedClusterIpAssignments `json:"ip_assignments"`
		PostGISEnabled bool                        `json:"postgis_enabled"`
	} `json:"data"`
}

type CreateDatabaseInput added in v0.3.210

type CreateDatabaseInput struct {
	Name string `json:"name"`
}

type CreateDatabaseResponse added in v0.3.210

type CreateDatabaseResponse struct {
	Data Database `json:"data"`
}

type CreateFlyManagedBuilderInput added in v0.3.149

type CreateFlyManagedBuilderInput struct {
	Builder CreateFlyManagedBuilderParams `json:"builder"`
}

type CreateFlyManagedBuilderParams added in v0.3.149

type CreateFlyManagedBuilderParams struct {
	Region string `json:"region"`
}

type CreateFlyManagedBuilderResponse added in v0.3.149

type CreateFlyManagedBuilderResponse struct {
	Data   FlyManagedBuilder `json:"data"`
	Errors DetailedErrors    `json:"errors"`
}

type CreateManagedClusterBackupInput added in v0.3.198

type CreateManagedClusterBackupInput struct {
	Type string `json:"type"`
}

type CreateManagedClusterBackupResponse added in v0.3.198

type CreateManagedClusterBackupResponse struct {
	Data ManagedClusterBackup `json:"data"`
}

type CreateReleaseRequest added in v0.3.214

type CreateReleaseRequest struct {
	AppName    string             `json:"app_name"`
	BuildId    int64              `json:"build_id"`
	Definition any                `json:"definition"`
	Image      string             `json:"image"`
	Strategy   DeploymentStrategy `json:"strategy"`
}

type CreateUserInput added in v0.3.99

type CreateUserInput struct {
	DbName   string `json:"db_name"`
	UserName string `json:"user_name"`
}

type CreateUserResponse added in v0.3.99

type CreateUserResponse struct {
	ConnectionUri string         `json:"connection_uri"`
	Ok            bool           `json:"ok"`
	Errors        DetailedErrors `json:"errors"`
}

type CreateUserWithRoleInput added in v0.3.211

type CreateUserWithRoleInput struct {
	UserName string `json:"user_name"`
	Role     string `json:"role"` // 'schema_admin' | 'writer' | 'reader'
}

type CreateUserWithRoleResponse added in v0.3.211

type CreateUserWithRoleResponse struct {
	Data User `json:"data"`
}

type Database added in v0.3.210

type Database struct {
	Name string `json:"name"`
}

type DeleteAttachmentResponse added in v0.4.2

type DeleteAttachmentResponse struct {
	Data struct {
		Message string `json:"message"`
	} `json:"data"`
}

type DeploymentStrategy added in v0.3.214

type DeploymentStrategy string
const (
	// Launch all new instances before shutting down previous instances
	DeploymentStrategyBluegreen DeploymentStrategy = "BLUEGREEN"
	// Ensure new instances are healthy before continuing with a rolling deployment
	DeploymentStrategyCanary DeploymentStrategy = "CANARY"
	// Deploy new instances all at once
	DeploymentStrategyImmediate DeploymentStrategy = "IMMEDIATE"
	// Incrementally replace old instances with new ones
	DeploymentStrategyRolling DeploymentStrategy = "ROLLING"
	// Incrementally replace old instances with new ones, 1 by 1
	DeploymentStrategyRollingOne DeploymentStrategy = "ROLLING_ONE"
	// Deploy new instances all at once
	DeploymentStrategySimple DeploymentStrategy = "SIMPLE"
)

type DetailedErrors added in v0.3.99

type DetailedErrors struct {
	Detail string `json:"detail"`
}

type EnsureDepotBuilderRequest added in v0.3.214

type EnsureDepotBuilderRequest struct {
	AppName        *string `json:"app_name,omitempty"`
	BuilderScope   *string `json:"builder_scope,omitempty"`
	OrganizationId *string `json:"organization_id,omitempty"`
	Region         *string `json:"region,omitempty"`
}

type EnsureDepotBuilderResponse added in v0.3.214

type EnsureDepotBuilderResponse struct {
	BuildId    *string `json:"build_id"`
	BuildToken *string `json:"build_token"`
}

type FinishBuildRequest added in v0.3.214

type FinishBuildRequest struct {
	BuildId             int64                  `json:"build_id"`
	AppName             string                 `json:"app_name"`
	MachineId           string                 `json:"machine_id"`
	Status              string                 `json:"status"`
	StrategiesAttempted []BuildStrategyAttempt `json:"strategies_attempted"`
	BuilderMeta         BuilderMeta            `json:"builder_meta"`
	FinalImage          BuildFinalImage        `json:"final_image"`
	Timings             BuildTimings           `json:"timings"`
	Logs                string                 `json:"logs"`
}

type FlyManagedBuilder added in v0.3.149

type FlyManagedBuilder struct {
	AppName   string `json:"app_name"`
	MachineID string `json:"machine_id"`
}

type GetManagedClusterCredentialsResponse added in v0.3.112

type GetManagedClusterCredentialsResponse struct {
	Status        string `json:"status"`
	User          string `json:"user"`
	Password      string `json:"password"`
	DBName        string `json:"dbname"`
	ConnectionUri string `json:"pgbouncer_uri"`
}

type GetManagedClusterResponse

type GetManagedClusterResponse struct {
	Data        ManagedCluster                       `json:"data"`
	Credentials GetManagedClusterCredentialsResponse `json:"credentials"`
}

type GetUserCredentialsResponse added in v0.3.211

type GetUserCredentialsResponse struct {
	Data struct {
		User     string `json:"user"`
		Password string `json:"password"`
	} `json:"data"`
}

type ListDatabasesResponse added in v0.3.210

type ListDatabasesResponse struct {
	Data []Database `json:"data"`
}

type ListMPGRegionsResponse added in v0.3.145

type ListMPGRegionsResponse struct {
	Data []MPGRegion `json:"data"`
}

type ListManagedClusterBackupsResponse added in v0.3.198

type ListManagedClusterBackupsResponse struct {
	Data []ManagedClusterBackup `json:"data"`
}

type ListManagedClustersResponse

type ListManagedClustersResponse struct {
	Data []ManagedCluster `json:"data"`
}

type ListUsersResponse added in v0.3.211

type ListUsersResponse struct {
	Data []User `json:"data"`
}

type MPGRegion added in v0.3.145

type MPGRegion struct {
	Code      string `json:"code"`      // e.g., "fra"
	Available bool   `json:"available"` // Whether this region supports MPG
}

type ManagedCluster

type ManagedCluster struct {
	Id            string                      `json:"id"`
	Name          string                      `json:"name"`
	Region        string                      `json:"region"`
	Status        string                      `json:"status"`
	Plan          string                      `json:"plan"`
	Disk          int                         `json:"disk"`
	Replicas      int                         `json:"replicas"`
	Organization  fly.Organization            `json:"organization"`
	IpAssignments ManagedClusterIpAssignments `json:"ip_assignments"`
	AttachedApps  []AttachedApp               `json:"attached_apps"`
}

type ManagedClusterBackup added in v0.3.198

type ManagedClusterBackup struct {
	Id     string `json:"id"`
	Status string `json:"status"`
	Type   string `json:"type"`
	Start  string `json:"start"`
	Stop   string `json:"stop"`
}

type ManagedClusterIpAssignments

type ManagedClusterIpAssignments struct {
	Direct string `json:"direct"`
}

type NewClientOpts

type NewClientOpts struct {
	// optional, sent with requests
	UserAgent string

	// URL used when connecting via usermode wireguard.
	BaseURL *url.URL

	Tokens *tokens.Tokens

	// optional:
	Logger fly.Logger

	// optional, used to construct the underlying HTTP client
	Transport http.RoundTripper
}

type Organization added in v0.3.214

type Organization struct {
	ID                       string        `json:"id"`
	InternalNumericID        uint64        `json:"internal_numeric_id"`
	Slug                     string        `json:"slug"`
	RawSlug                  string        `json:"raw_slug"`
	PaidPlan                 bool          `json:"paid_plan"`
	Personal                 bool          `json:"personal"`
	BillingStatus            BillingStatus `json:"billing_status"`
	ProvisionsBetaExtensions bool          `json:"provisions_beta_extensions"`
	Name                     string        `json:"name"`
	Billable                 bool          `json:"billable"`
	RemoteBuilderImage       string        `json:"remote_builder_image"`
}

type Release added in v0.3.214

type Release struct {
	ID                 string             `json:"id"`
	Version            int                `json:"version"`
	Stable             bool               `json:"stable"`
	InProgress         bool               `json:"in_progress"`
	Status             string             `json:"status"`
	DeploymentStrategy DeploymentStrategy `json:"strategy"`
	User               string             `json:"user"`
	CreatedAt          time.Time          `json:"created_at"`
	ImageRef           string             `json:"image_ref"`
}

type RestoreManagedClusterBackupInput added in v0.3.198

type RestoreManagedClusterBackupInput struct {
	BackupId string `json:"backup_id"`
}

type RestoreManagedClusterBackupResponse added in v0.3.198

type RestoreManagedClusterBackupResponse struct {
	Data ManagedCluster `json:"data"`
}

type UpdateUserRoleInput added in v0.3.211

type UpdateUserRoleInput struct {
	Role string `json:"role"` // 'schema_admin' | 'writer' | 'reader'
}

type UpdateUserRoleResponse added in v0.3.211

type UpdateUserRoleResponse struct {
	Data User `json:"data"`
}

type User added in v0.3.211

type User struct {
	Name string `json:"name"`
	Role string `json:"role"`
}

Jump to

Keyboard shortcuts

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