uiexutil

package
v0.4.101 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppOrganization added in v0.4.101

func AppOrganization(ctx context.Context, app *flaps.App) (*uiex.Organization, error)

AppOrganization returns the organization that owns app, looked up by the org slug Flaps reports for it.

func LatestRelease added in v0.4.101

func LatestRelease(ctx context.Context, client Client, appName string) (*uiex.Release, error)

LatestRelease returns the app's most recent release regardless of status, matching the GraphQL currentReleaseUnprocessed field, or nil when the app has no releases yet.

It deliberately uses the release list rather than the releases/current endpoint: that endpoint only considers complete releases, and fails for apps that have none.

func NewClientWithOptions

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

func NewContextWithClient

func NewContextWithClient(ctx context.Context, c Client) context.Context

NewContextWithClient derives a Context that carries c from ctx.

Types

type Client

type Client interface {
	// Transport
	BaseURL() *url.URL
	HTTPClient() *http.Client

	// Basic
	ListOrganizations(ctx context.Context, admin bool) ([]uiex.Organization, error)
	GetOrganization(ctx context.Context, orgSlug string) (*uiex.Organization, error)

	// Egress IPs
	PromoteMachineEgressIP(ctx context.Context, appName string, egressIP string) error

	// Builders
	CreateBuild(ctx context.Context, in uiex.CreateBuildRequest) (*uiex.BuildResponse, error)
	FinishBuild(ctx context.Context, in uiex.FinishBuildRequest) (*uiex.BuildResponse, error)
	EnsureDepotBuilder(ctx context.Context, in uiex.EnsureDepotBuilderRequest) (*uiex.EnsureDepotBuilderResponse, error)
	CreateFlyManagedBuilder(ctx context.Context, orgSlug string, region string) (uiex.CreateFlyManagedBuilderResponse, error)

	// Releases
	GetAllAppsCurrentReleaseTimestamps(ctx context.Context) (*map[string]time.Time, error)
	ListReleases(ctx context.Context, appName string, count int) ([]uiex.Release, error)
	GetCurrentRelease(ctx context.Context, appName string) (*uiex.Release, error)
	CreateRelease(ctx context.Context, req uiex.CreateReleaseRequest) (*uiex.Release, error)
	UpdateRelease(ctx context.Context, releaseID, status string, metadata any) (*uiex.Release, error)
}

func ClientFromContext

func ClientFromContext(ctx context.Context) Client

ClientFromContext returns the Client ctx carries.

Jump to

Keyboard shortcuts

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