fly

package module
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 29 Imported by: 16

README

fly-go

Go client for the Fly.io API. This library is primarily used by flyctl but it can be used by any project that wants to automate its Fly.io deployment.

Development

If you are making changes in another project and need to test fly-go changes locally, you can enable a Go workspace. For example, if you have a directory structure like this:

superfly/
├── fly-go
└── flyctl

Then you can initialize a Go workspace in the superfly parent directory and add your project directories so that flyctl can use your local fly-go:

go work init
go work use ./flyctl
go work use ./fly-go

Cutting a Release

If you have write access to this repo, you can ship a release with:

scripts/bump_version.sh

Or a prerelease with:

scripts/bump_version.sh prerel

The release and notes will be created automatically via Github Actions. Follow along in: https://github.com/superfly/fly-go/actions/workflows/release.yml

Documentation

Index

Constants

View Source
const (
	MachineConfigMetadataKeyFlyManagedPostgres  = "fly-managed-postgres"
	MachineConfigMetadataKeyFlyPlatformVersion  = "fly_platform_version"
	MachineConfigMetadataKeyFlyReleaseId        = "fly_release_id"
	MachineConfigMetadataKeyFlyReleaseVersion   = "fly_release_version"
	MachineConfigMetadataKeyFlyProcessGroup     = "fly_process_group"
	MachineConfigMetadataKeyFlyPreviousAlloc    = "fly_previous_alloc"
	MachineConfigMetadataKeyFlyctlVersion       = "fly_flyctl_version"
	MachineConfigMetadataKeyFlyctlBGTag         = "fly_bluegreen_deployment_tag"
	MachineFlyPlatformVersion2                  = "v2"
	MachineProcessGroupApp                      = "app"
	MachineProcessGroupFlyAppReleaseCommand     = "fly_app_release_command"
	MachineProcessGroupFlyAppTestMachineCommand = "fly_app_test_machine_command"
	MachineProcessGroupFlyAppConsole            = "fly_app_console"
	MachineStateDestroyed                       = "destroyed"
	MachineStateDestroying                      = "destroying"
	MachineStateStarted                         = "started"
	MachineStateStopped                         = "stopped"
	MachineStateSuspended                       = "suspended"
	MachineStateCreated                         = "created"
	DefaultVMSize                               = "shared-cpu-1x"
	DefaultGPUVMSize                            = "performance-8x"
)
View Source
const (
	MIN_MEMORY_MB_PER_SHARED_CPU = 256
	MIN_MEMORY_MB_PER_CPU        = 2048

	MAX_MEMORY_MB_PER_SHARED_CPU = 2048
	MAX_MEMORY_MB_PER_CPU        = 8192
)
View Source
const (
	// Secret types
	AppSecret                      = "AppSecret"
	VolumeEncryptionKey            = "VolumeEncryptionKey"
	SECRET_TYPE_KMS_HS256          = "SECRET_TYPE_KMS_HS256"
	SECRET_TYPE_KMS_HS384          = "SECRET_TYPE_KMS_HS384"
	SECRET_TYPE_KMS_HS512          = "SECRET_TYPE_KMS_HS512"
	SECRET_TYPE_KMS_XAES256GCM     = "SECRET_TYPE_KMS_XAES256GCM"
	SECRET_TYPE_KMS_NACL_AUTH      = "SECRET_TYPE_KMS_NACL_AUTH"
	SECRET_TYPE_KMS_NACL_BOX       = "SECRET_TYPE_KMS_NACL_BOX"
	SECRET_TYPE_KMS_NACL_SECRETBOX = "SECRET_TYPE_KMS_NACL_SECRETBOX"
	SECRET_TYPE_KMS_NACL_SIGN      = "SECRET_TYPE_KMS_NACL_SIGN"
)
View Source
const CreateBuild_Operation = `
mutation CreateBuild ($input: CreateBuildInput!) {
	createBuild(input: $input) {
		id
		status
	}
}
`

The mutation executed by CreateBuild.

View Source
const CreateRelease_Operation = `` /* 126-byte string literal not displayed */

The mutation executed by CreateRelease.

View Source
const EnsureDepotRemoteBuilder_Operation = `` /* 149-byte string literal not displayed */

The mutation executed by EnsureDepotRemoteBuilder.

View Source
const FinishBuild_Operation = `
mutation FinishBuild ($input: FinishBuildInput!) {
	finishBuild(input: $input) {
		id
		status
		wallclockTimeMs
	}
}
`

The mutation executed by FinishBuild.

View Source
const LatestImage_Operation = `` /* 132-byte string literal not displayed */

The query executed by LatestImage.

View Source
const UpdateRelease_Operation = `
mutation UpdateRelease ($input: UpdateReleaseInput!) {
	updateRelease(input: $input) {
		release {
			id
		}
	}
}
`

The mutation executed by UpdateRelease.

Variables

View Source
var ErrNoAuthToken = errors.New("No access token available. Please login with 'flyctl auth login'")
View Source
var ErrNotFound = errors.New("Not Found")

ErrNotFound - Error to return when something is not found

View Source
var ErrUnknown = errors.New("An unknown server error occurred, please try again")

ErrUnknown - Error to return when an unknown server error occurs

View Source
var MachinePresets map[string]*MachineGuest = map[string]*MachineGuest{
	"shared-cpu-1x": {CPUKind: "shared", CPUs: 1, MemoryMB: 1 * MIN_MEMORY_MB_PER_SHARED_CPU},
	"shared-cpu-2x": {CPUKind: "shared", CPUs: 2, MemoryMB: 2 * MIN_MEMORY_MB_PER_SHARED_CPU},
	"shared-cpu-4x": {CPUKind: "shared", CPUs: 4, MemoryMB: 4 * MIN_MEMORY_MB_PER_SHARED_CPU},
	"shared-cpu-8x": {CPUKind: "shared", CPUs: 8, MemoryMB: 8 * MIN_MEMORY_MB_PER_SHARED_CPU},

	"performance-1x":  {CPUKind: "performance", CPUs: 1, MemoryMB: 1 * MIN_MEMORY_MB_PER_CPU},
	"performance-2x":  {CPUKind: "performance", CPUs: 2, MemoryMB: 2 * MIN_MEMORY_MB_PER_CPU},
	"performance-4x":  {CPUKind: "performance", CPUs: 4, MemoryMB: 4 * MIN_MEMORY_MB_PER_CPU},
	"performance-8x":  {CPUKind: "performance", CPUs: 8, MemoryMB: 8 * MIN_MEMORY_MB_PER_CPU},
	"performance-16x": {CPUKind: "performance", CPUs: 16, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU},

	"a100-40gb": {GPUKind: "a100-pcie-40gb", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU},
	"a100-80gb": {GPUKind: "a100-sxm4-80gb", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU},
	"l40s":      {GPUKind: "l40s", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU},
	"a10":       {GPUKind: "a10", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU},
}

TODO - Determine if we want allocate max memory allocation, or minimum per # cpus.

Functions

func AuthorizationHeader

func AuthorizationHeader(token string) string

func BoolPointer

func BoolPointer(val bool) *bool

BoolPointer - Returns a pointer to a bool

func GetAccessToken

func GetAccessToken(ctx context.Context, email, password, otp string) (token string, err error)

GetAccessToken - uses email, password and possible otp to get token

func GetAccessTokenForCLISession

func GetAccessTokenForCLISession(ctx context.Context, id string) (string, error)

GetAccessTokenForCLISession Obtains the access token for the session

func IntPointer

func IntPointer(val int) *int

IntPointer - Returns a pointer to an int

func IsClientError

func IsClientError(err error) bool

func IsNotAuthenticatedError

func IsNotAuthenticatedError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsServerError

func IsServerError(err error) bool

func MergeFiles added in v0.1.3

func MergeFiles(machineConf *MachineConfig, files []*File)

MergeFiles merges the files parsed from the command line or fly.toml into the machine configuration.

func NewHTTPClient

func NewHTTPClient(logger Logger, transport http.RoundTripper) (*http.Client, error)

func Pointer

func Pointer[T any](val T) *T

Pointer - Returns a pointer to a any type

func SetBaseURL

func SetBaseURL(url string)

SetBaseURL - Sets the base URL for the API

func SetErrorLog

func SetErrorLog(log bool)

SetErrorLog - Sets whether errors should be loddes

func SetInstrumenter

func SetInstrumenter(i InstrumentationService)

func SetTransport

func SetTransport(t http.RoundTripper)

func StringPointer

func StringPointer(val string) *string

StringPointer - Returns a pointer to a string

func WithAuthorizationHeader

func WithAuthorizationHeader(ctx context.Context, hdr string) context.Context

WithAuthorizationHeader returns a context that instructs the client to use the specified Authorization header value.

Types

type AllocateEgressIPAddressInput added in v0.1.29

type AllocateEgressIPAddressInput struct {
	AppID     string `json:"appId"`
	MachineID string `json:"machineId"`
}

type AllocateIPAddressInput

type AllocateIPAddressInput struct {
	AppID          string `json:"appId"`
	Type           string `json:"type"`
	Region         string `json:"region"`
	OrganizationID string `json:"organizationId,omitempty"`
	Network        string `json:"network,omitempty"`
}

type ApiError

type ApiError struct {
	WrappedError error
	Message      string
	Status       int
}

func ErrorFromResp

func ErrorFromResp(resp *http.Response) *ApiError

func (*ApiError) Error

func (e *ApiError) Error() string

type App

type App struct {
	ID                string
	InternalNumericID int32
	Name              string
	State             string
	Status            string
	Deployed          bool
	Hostname          string
	AppURL            string
	Version           int
	NetworkID         int
	Network           string

	Release        *Release
	Organization   Organization
	Secrets        []Secret
	CurrentRelease *Release
	Releases       struct {
		Nodes []Release
	}
	IPAddresses struct {
		Nodes []IPAddress
	}
	SharedIPAddress string
	IPAddress       *IPAddress
	Certificates    struct {
		Nodes []AppCertificate
	}
	Certificate     AppCertificate
	PostgresAppRole *struct {
		Name string
	}
	Image *Image

	ImageUpgradeAvailable       bool
	ImageVersionTrackingEnabled bool
	ImageDetails                ImageVersion
	LatestImageDetails          ImageVersion

	PlatformVersion     string
	LimitedAccessTokens *struct {
		Nodes []LimitedAccessToken
	}

	Machines struct {
		Nodes []GqlMachine
	}

	CurrentLock *struct {
		LockID     string
		Expiration string
	}
}

func (*App) Compact added in v0.1.16

func (app *App) Compact() *AppCompact

type AppBasic

type AppBasic struct {
	ID              string
	Name            string
	PlatformVersion string
	Organization    *OrganizationBasic
}

type AppCertificate

type AppCertificate struct {
	ID                        string
	AcmeDNSConfigured         bool
	AcmeALPNConfigured        bool
	Configured                bool
	CertificateAuthority      string
	CreatedAt                 time.Time
	DNSProvider               string
	DNSValidationInstructions string
	DNSValidationHostname     string
	DNSValidationTarget       string
	Hostname                  string
	Source                    string
	ClientStatus              string
	IsApex                    bool
	IsWildcard                bool
	Issued                    struct {
		Nodes []struct {
			ExpiresAt time.Time
			Type      string
		}
	}
}

type AppCertificateCompact

type AppCertificateCompact struct {
	CreatedAt    time.Time
	Hostname     string
	ClientStatus string
}

type AppCertsCompact

type AppCertsCompact struct {
	Certificates struct {
		Nodes []AppCertificateCompact
	}
}

type AppCompact

type AppCompact struct {
	ID              string
	Name            string
	Status          string
	Deployed        bool
	Hostname        string
	AppURL          string
	Organization    *OrganizationBasic
	PlatformVersion string
	PostgresAppRole *struct {
		Name string
	}
}

func (*AppCompact) IsPostgresApp

func (app *AppCompact) IsPostgresApp() bool

type AppHostIssues added in v0.1.14

type AppHostIssues struct {
	HostIssues struct {
		Nodes []HostIssue
	}
}

type AppInfo

type AppInfo struct {
	ID              string
	Name            string
	Status          string
	Deployed        bool
	Hostname        string
	Version         int
	PlatformVersion string
	Organization    *OrganizationBasic
	IPAddresses     struct {
		Nodes []IPAddress
	}
}

type AttachPostgresClusterInput

type AttachPostgresClusterInput struct {
	AppID                string  `json:"appId"`
	PostgresClusterAppID string  `json:"postgresClusterAppId"`
	DatabaseName         *string `json:"databaseName,omitempty"`
	DatabaseUser         *string `json:"databaseUser,omitempty"`
	VariableName         *string `json:"variableName,omitempty"`
	ManualEntry          bool    `json:"manualEntry,omitempty"`
}

type AttachPostgresClusterPayload

type AttachPostgresClusterPayload struct {
	App                     App
	PostgresClusterApp      App
	ConnectionString        string
	EnvironmentVariableName string
}

type Billable

type Billable struct {
	Category string
	Product  string
	Time     time.Time
	Quantity float64
	App      App
}

type BuildFinalImageInput added in v0.1.13

type BuildFinalImageInput struct {
	// Sha256 id of docker image
	Id string `json:"id"`
	// Size in bytes of the docker image
	SizeBytes int64 `json:"sizeBytes"`
	// Tag used for docker image
	Tag string `json:"tag"`
}

func (*BuildFinalImageInput) GetId added in v0.1.13

func (v *BuildFinalImageInput) GetId() string

GetId returns BuildFinalImageInput.Id, and is useful for accessing the field via an interface.

func (*BuildFinalImageInput) GetSizeBytes added in v0.1.13

func (v *BuildFinalImageInput) GetSizeBytes() int64

GetSizeBytes returns BuildFinalImageInput.SizeBytes, and is useful for accessing the field via an interface.

func (*BuildFinalImageInput) GetTag added in v0.1.13

func (v *BuildFinalImageInput) GetTag() string

GetTag returns BuildFinalImageInput.Tag, and is useful for accessing the field via an interface.

type BuildImageOptsInput added in v0.1.13

type BuildImageOptsInput struct {
	// Set of build time variables passed to cli
	BuildArgs interface{} `json:"buildArgs"`
	// Fly.toml build.buildpacks setting
	BuildPacks []string `json:"buildPacks"`
	// Fly.toml build.builder setting
	Builder string `json:"builder"`
	// Builtin builder to use
	BuiltIn string `json:"builtIn"`
	// Builtin builder settings
	BuiltInSettings interface{} `json:"builtInSettings"`
	// Path to dockerfile, if one exists
	DockerfilePath string `json:"dockerfilePath"`
	// Unused in cli?
	ExtraBuildArgs interface{} `json:"extraBuildArgs"`
	// Image label to use when tagging and pushing to the fly registry
	ImageLabel string `json:"imageLabel"`
	// Unused in cli?
	ImageRef string `json:"imageRef"`
	// Do not use the build cache when building the image
	NoCache bool `json:"noCache"`
	// Whether publishing to the registry was requested
	Publish bool `json:"publish"`
	// Docker tag used to publish image to registry
	Tag string `json:"tag"`
	// Set the target build stage to build if the Dockerfile has more than one stage
	Target string `json:"target"`
}

func (*BuildImageOptsInput) GetBuildArgs added in v0.1.13

func (v *BuildImageOptsInput) GetBuildArgs() interface{}

GetBuildArgs returns BuildImageOptsInput.BuildArgs, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetBuildPacks added in v0.1.13

func (v *BuildImageOptsInput) GetBuildPacks() []string

GetBuildPacks returns BuildImageOptsInput.BuildPacks, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetBuilder added in v0.1.13

func (v *BuildImageOptsInput) GetBuilder() string

GetBuilder returns BuildImageOptsInput.Builder, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetBuiltIn added in v0.1.13

func (v *BuildImageOptsInput) GetBuiltIn() string

GetBuiltIn returns BuildImageOptsInput.BuiltIn, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetBuiltInSettings added in v0.1.13

func (v *BuildImageOptsInput) GetBuiltInSettings() interface{}

GetBuiltInSettings returns BuildImageOptsInput.BuiltInSettings, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetDockerfilePath added in v0.1.13

func (v *BuildImageOptsInput) GetDockerfilePath() string

GetDockerfilePath returns BuildImageOptsInput.DockerfilePath, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetExtraBuildArgs added in v0.1.13

func (v *BuildImageOptsInput) GetExtraBuildArgs() interface{}

GetExtraBuildArgs returns BuildImageOptsInput.ExtraBuildArgs, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetImageLabel added in v0.1.13

func (v *BuildImageOptsInput) GetImageLabel() string

GetImageLabel returns BuildImageOptsInput.ImageLabel, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetImageRef added in v0.1.13

func (v *BuildImageOptsInput) GetImageRef() string

GetImageRef returns BuildImageOptsInput.ImageRef, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetNoCache added in v0.1.13

func (v *BuildImageOptsInput) GetNoCache() bool

GetNoCache returns BuildImageOptsInput.NoCache, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetPublish added in v0.1.13

func (v *BuildImageOptsInput) GetPublish() bool

GetPublish returns BuildImageOptsInput.Publish, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetTag added in v0.1.13

func (v *BuildImageOptsInput) GetTag() string

GetTag returns BuildImageOptsInput.Tag, and is useful for accessing the field via an interface.

func (*BuildImageOptsInput) GetTarget added in v0.1.13

func (v *BuildImageOptsInput) GetTarget() string

GetTarget returns BuildImageOptsInput.Target, and is useful for accessing the field via an interface.

type BuildStrategyAttemptInput added in v0.1.13

type BuildStrategyAttemptInput struct {
	// Optional error message from strategy
	Error string `json:"error"`
	// Optional note about this strategy or its result
	Note string `json:"note"`
	// Result attempting this strategy
	Result string `json:"result"`
	// Build strategy attempted
	Strategy string `json:"strategy"`
}

func (*BuildStrategyAttemptInput) GetError added in v0.1.13

func (v *BuildStrategyAttemptInput) GetError() string

GetError returns BuildStrategyAttemptInput.Error, and is useful for accessing the field via an interface.

func (*BuildStrategyAttemptInput) GetNote added in v0.1.13

func (v *BuildStrategyAttemptInput) GetNote() string

GetNote returns BuildStrategyAttemptInput.Note, and is useful for accessing the field via an interface.

func (*BuildStrategyAttemptInput) GetResult added in v0.1.13

func (v *BuildStrategyAttemptInput) GetResult() string

GetResult returns BuildStrategyAttemptInput.Result, and is useful for accessing the field via an interface.

func (*BuildStrategyAttemptInput) GetStrategy added in v0.1.13

func (v *BuildStrategyAttemptInput) GetStrategy() string

GetStrategy returns BuildStrategyAttemptInput.Strategy, and is useful for accessing the field via an interface.

type BuildTimingsInput added in v0.1.13

type BuildTimingsInput struct {
	// Time to build and push the image, measured by flyctl
	BuildAndPushMs int64 `json:"buildAndPushMs"`
	// Time to build the image including create context, measured by flyctl
	BuildMs int64 `json:"buildMs"`
	// Time to initialize client used to connect to either remote or local builder
	BuilderInitMs int64 `json:"builderInitMs"`
	// Time to create the build context tar file, measured by flyctl
	ContextBuildMs int64 `json:"contextBuildMs"`
	// Time for builder to build image after receiving context, measured by flyctl
	ImageBuildMs int64 `json:"imageBuildMs"`
	// Time to push completed image to registry, measured by flyctl
	PushMs int64 `json:"pushMs"`
}

func (*BuildTimingsInput) GetBuildAndPushMs added in v0.1.13

func (v *BuildTimingsInput) GetBuildAndPushMs() int64

GetBuildAndPushMs returns BuildTimingsInput.BuildAndPushMs, and is useful for accessing the field via an interface.

func (*BuildTimingsInput) GetBuildMs added in v0.1.13

func (v *BuildTimingsInput) GetBuildMs() int64

GetBuildMs returns BuildTimingsInput.BuildMs, and is useful for accessing the field via an interface.

func (*BuildTimingsInput) GetBuilderInitMs added in v0.1.13

func (v *BuildTimingsInput) GetBuilderInitMs() int64

GetBuilderInitMs returns BuildTimingsInput.BuilderInitMs, and is useful for accessing the field via an interface.

func (*BuildTimingsInput) GetContextBuildMs added in v0.1.13

func (v *BuildTimingsInput) GetContextBuildMs() int64

GetContextBuildMs returns BuildTimingsInput.ContextBuildMs, and is useful for accessing the field via an interface.

func (*BuildTimingsInput) GetImageBuildMs added in v0.1.13

func (v *BuildTimingsInput) GetImageBuildMs() int64

GetImageBuildMs returns BuildTimingsInput.ImageBuildMs, and is useful for accessing the field via an interface.

func (*BuildTimingsInput) GetPushMs added in v0.1.13

func (v *BuildTimingsInput) GetPushMs() int64

GetPushMs returns BuildTimingsInput.PushMs, and is useful for accessing the field via an interface.

type BuilderMetaInput added in v0.1.13

type BuilderMetaInput struct {
	// Local or remote builder type
	BuilderType string `json:"builderType"`
	// Whther or not buildkit is enabled on builder
	BuildkitEnabled bool `json:"buildkitEnabled"`
	// Docker version reported by builder
	DockerVersion string `json:"dockerVersion"`
	// Platform reported by the builder
	Platform string `json:"platform"`
	// Remote builder app used
	RemoteAppName string `json:"remoteAppName"`
	// Remote builder machine used
	RemoteMachineId string `json:"remoteMachineId"`
}

func (*BuilderMetaInput) GetBuilderType added in v0.1.13

func (v *BuilderMetaInput) GetBuilderType() string

GetBuilderType returns BuilderMetaInput.BuilderType, and is useful for accessing the field via an interface.

func (*BuilderMetaInput) GetBuildkitEnabled added in v0.1.13

func (v *BuilderMetaInput) GetBuildkitEnabled() bool

GetBuildkitEnabled returns BuilderMetaInput.BuildkitEnabled, and is useful for accessing the field via an interface.

func (*BuilderMetaInput) GetDockerVersion added in v0.1.13

func (v *BuilderMetaInput) GetDockerVersion() string

GetDockerVersion returns BuilderMetaInput.DockerVersion, and is useful for accessing the field via an interface.

func (*BuilderMetaInput) GetPlatform added in v0.1.13

func (v *BuilderMetaInput) GetPlatform() string

GetPlatform returns BuilderMetaInput.Platform, and is useful for accessing the field via an interface.

func (*BuilderMetaInput) GetRemoteAppName added in v0.1.13

func (v *BuilderMetaInput) GetRemoteAppName() string

GetRemoteAppName returns BuilderMetaInput.RemoteAppName, and is useful for accessing the field via an interface.

func (*BuilderMetaInput) GetRemoteMachineId added in v0.1.13

func (v *BuilderMetaInput) GetRemoteMachineId() string

GetRemoteMachineId returns BuilderMetaInput.RemoteMachineId, and is useful for accessing the field via an interface.

type CLISession

type CLISession struct {
	ID          string                 `json:"id"`
	URL         string                 `json:"auth_url,omitempty"`
	AccessToken string                 `json:"access_token,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

func GetCLISessionState

func GetCLISessionState(ctx context.Context, id string) (CLISession, error)

func StartCLISession

func StartCLISession(sessionName string, args map[string]interface{}) (CLISession, error)

StartCLISession starts a session with the platform via web

func StartCLISessionWebAuth

func StartCLISessionWebAuth(machineName string, signup bool) (CLISession, error)

StartCLISessionWebAuth starts a session with the platform via web auth

type CLISessionAuth

type CLISessionAuth struct {
	CLISession
}

type CheckDomainResult

type CheckDomainResult struct {
	DomainName            string
	TLD                   string
	RegistrationSupported bool
	RegistrationAvailable bool
	RegistrationPrice     int
	RegistrationPeriod    int
	TransferAvailable     bool
	DnsAvailable          bool
}

type Client

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

Client - API client encapsulating the http and GraphQL clients

func NewClient

func NewClient(accessToken, name, version string, logger Logger) *Client

NewClient - creates a new Client, takes an access token

func NewClientFromOptions

func NewClientFromOptions(opts ClientOptions) *Client

func (*Client) AddCertificate

func (c *Client) AddCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)

func (*Client) AllocateEgressIPAddress added in v0.1.29

func (c *Client) AllocateEgressIPAddress(ctx context.Context, appName string, machineId string) (net.IP, net.IP, error)

func (*Client) AllocateIPAddress

func (c *Client) AllocateIPAddress(ctx context.Context, appName string, addrType string, region string, org *Organization, network string) (*IPAddress, error)

func (*Client) AllocateSharedIPAddress

func (c *Client) AllocateSharedIPAddress(ctx context.Context, appName string) (net.IP, error)

func (*Client) AppNameAvailable added in v0.1.11

func (client *Client) AppNameAvailable(ctx context.Context, appName string) (bool, error)

func (*Client) AttachPostgresCluster

func (client *Client) AttachPostgresCluster(ctx context.Context, input AttachPostgresClusterInput) (*AttachPostgresClusterPayload, error)

func (*Client) Authenticated

func (c *Client) Authenticated() bool

func (*Client) CanPerformBluegreenDeployment

func (c *Client) CanPerformBluegreenDeployment(ctx context.Context, appName string) (bool, error)

func (*Client) CheckAppCertificate

func (c *Client) CheckAppCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)

func (*Client) CheckDomain

func (c *Client) CheckDomain(ctx context.Context, name string) (*CheckDomainResult, error)

func (*Client) ClosestWireguardGatewayRegion

func (c *Client) ClosestWireguardGatewayRegion(ctx context.Context) (*Region, error)

func (*Client) CreateAndRegisterDomain

func (c *Client) CreateAndRegisterDomain(organizationID string, name string) (*Domain, error)

func (*Client) CreateApp

func (client *Client) CreateApp(ctx context.Context, input CreateAppInput) (*App, error)

func (*Client) CreateBuild added in v0.1.13

func (c *Client) CreateBuild(ctx context.Context, input CreateBuildInput) (*CreateBuildResponse, error)

func (*Client) CreateDelegatedWireGuardToken

func (c *Client) CreateDelegatedWireGuardToken(ctx context.Context, org *Organization, name string) (*DelegatedWireGuardToken, error)

func (*Client) CreateDoctorUrl

func (c *Client) CreateDoctorUrl(ctx context.Context) (putUrl string, err error)

func (*Client) CreateDomain

func (c *Client) CreateDomain(organizationID string, name string) (*Domain, error)

func (*Client) CreateOrganization

func (c *Client) CreateOrganization(ctx context.Context, organizationname string) (*Organization, error)

func (*Client) CreateOrganizationInvite

func (c *Client) CreateOrganizationInvite(ctx context.Context, id, email string) (*Invitation, error)

func (*Client) CreateRelease added in v0.1.13

func (c *Client) CreateRelease(ctx context.Context, input CreateReleaseInput) (*CreateReleaseResponse, error)

func (*Client) CreateWireGuardPeer

func (c *Client) CreateWireGuardPeer(ctx context.Context, org *Organization, region, name, pubkey, network string) (*CreatedWireGuardPeer, error)

func (*Client) DeleteApp

func (client *Client) DeleteApp(ctx context.Context, appName string) error

func (*Client) DeleteCertificate

func (c *Client) DeleteCertificate(ctx context.Context, appName, hostname string) (*DeleteCertificatePayload, error)

func (*Client) DeleteDelegatedWireGuardToken

func (c *Client) DeleteDelegatedWireGuardToken(ctx context.Context, org *Organization, name, token *string) error

func (*Client) DeleteOrganization

func (c *Client) DeleteOrganization(ctx context.Context, id string) (deletedid string, err error)

func (*Client) DeleteOrganizationMembership

func (c *Client) DeleteOrganizationMembership(ctx context.Context, orgId, userId string) (string, string, error)

func (*Client) DetachPostgresCluster

func (client *Client) DetachPostgresCluster(ctx context.Context, input DetachPostgresClusterInput) error

func (*Client) EnablePostgresConsul

func (client *Client) EnablePostgresConsul(ctx context.Context, appName string) (*PostgresEnableConsulPayload, error)

func (*Client) EnsureDepotRemoteBuilder added in v0.1.19

func (client *Client) EnsureDepotRemoteBuilder(ctx context.Context, input *EnsureDepotRemoteBuilderInput) (*EnsureDepotRemoteBuilderResponse, error)

in order to auto generate the EnsureDepotRemoteBuilder function, we just need to create a string assigned to a variable, making sure to include the query, the input type, and the response type we use pointer: true to make specifying the inputs optional

func (*Client) EnsureRemoteBuilder

func (client *Client) EnsureRemoteBuilder(ctx context.Context, orgID, appName, region string) (*GqlMachine, *App, error)

func (*Client) ExportDNSRecords

func (c *Client) ExportDNSRecords(ctx context.Context, domainId string) (string, error)

func (*Client) FinishBuild added in v0.1.13

func (c *Client) FinishBuild(ctx context.Context, input FinishBuildInput) (*FinishBuildResponse, error)

func (*Client) GenqClient

func (c *Client) GenqClient() genq.Client

func (*Client) GetApp

func (client *Client) GetApp(ctx context.Context, appName string) (*App, error)

func (*Client) GetAppBasic

func (client *Client) GetAppBasic(ctx context.Context, appName string) (*AppBasic, error)

func (*Client) GetAppCertificates

func (c *Client) GetAppCertificates(ctx context.Context, appName string) ([]AppCertificateCompact, error)

func (*Client) GetAppCompact

func (client *Client) GetAppCompact(ctx context.Context, appName string) (*AppCompact, error)

func (*Client) GetAppCurrentReleaseMachines

func (c *Client) GetAppCurrentReleaseMachines(ctx context.Context, appName string) (*Release, error)

func (*Client) GetAppHostIssues added in v0.1.14

func (client *Client) GetAppHostIssues(ctx context.Context, appName string) ([]HostIssue, error)

func (*Client) GetAppLimitedAccessTokens

func (c *Client) GetAppLimitedAccessTokens(ctx context.Context, appName string) ([]LimitedAccessToken, error)

func (*Client) GetAppLock added in v0.1.29

func (client *Client) GetAppLock(ctx context.Context, name string) (*App, error)

func (*Client) GetAppLogs

func (c *Client) GetAppLogs(ctx context.Context, appName, token, region, instanceID string) (entries []LogEntry, nextToken string, err error)

func (*Client) GetAppNameFromVolume

func (c *Client) GetAppNameFromVolume(ctx context.Context, volID string) (*string, error)

func (*Client) GetAppNameStateFromVolume added in v0.1.8

func (c *Client) GetAppNameStateFromVolume(ctx context.Context, volID string) (*string, *string, error)

func (*Client) GetAppNetwork added in v0.1.5

func (client *Client) GetAppNetwork(ctx context.Context, appName string) (*string, error)

func (*Client) GetAppReleasesMachines

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

func (*Client) GetAppRemoteBuilder added in v0.1.15

func (client *Client) GetAppRemoteBuilder(ctx context.Context, appName string) (*App, error)

func (*Client) GetAppSecrets

func (c *Client) GetAppSecrets(ctx context.Context, appName string) ([]Secret, error)

func (*Client) GetApps

func (client *Client) GetApps(ctx context.Context, role *string) ([]App, error)

func (*Client) GetAppsForOrganization

func (client *Client) GetAppsForOrganization(ctx context.Context, orgID string) ([]App, error)

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (*User, error)

func (*Client) GetDNSRecords

func (c *Client) GetDNSRecords(ctx context.Context, domainName string) ([]*DNSRecord, error)

func (*Client) GetDelegatedWireGuardTokens

func (c *Client) GetDelegatedWireGuardTokens(ctx context.Context, slug string) ([]*DelegatedWireGuardTokenHandle, error)

func (*Client) GetDeployerAppByOrg added in v0.1.23

func (client *Client) GetDeployerAppByOrg(ctx context.Context, orgID string) (*App, error)

func (*Client) GetDetailedOrganizationBySlug

func (client *Client) GetDetailedOrganizationBySlug(ctx context.Context, slug string) (*OrganizationDetails, error)

func (*Client) GetDomain

func (c *Client) GetDomain(ctx context.Context, name string) (*Domain, error)

func (*Client) GetDomains

func (c *Client) GetDomains(ctx context.Context, organizationSlug string) ([]*Domain, error)

func (*Client) GetEgressIPAddresses added in v0.1.29

func (c *Client) GetEgressIPAddresses(ctx context.Context, appName string) (map[string][]EgressIPAddress, error)

func (*Client) GetIPAddresses

func (c *Client) GetIPAddresses(ctx context.Context, appName string) ([]IPAddress, error)

func (*Client) GetLatestImageDetails

func (client *Client) GetLatestImageDetails(ctx context.Context, image string) (*ImageVersion, error)

func (*Client) GetLatestImageTag

func (client *Client) GetLatestImageTag(ctx context.Context, repository string, snapshotId *string) (string, error)

func (*Client) GetLoggedCertificates

func (c *Client) GetLoggedCertificates(ctx context.Context, slug string) ([]LoggedCertificate, error)

func (*Client) GetMachine

func (client *Client) GetMachine(ctx context.Context, machineId string) (*GqlMachine, error)

func (*Client) GetNearestRegion

func (c *Client) GetNearestRegion(ctx context.Context) (*Region, error)

func (*Client) GetOrganizationByApp added in v0.1.15

func (client *Client) GetOrganizationByApp(ctx context.Context, appName string) (*Organization, error)

func (*Client) GetOrganizationBySlug

func (client *Client) GetOrganizationBySlug(ctx context.Context, slug string) (*Organization, error)

func (*Client) GetOrganizationRemoteBuilderBySlug added in v0.1.15

func (client *Client) GetOrganizationRemoteBuilderBySlug(ctx context.Context, slug string) (*Organization, error)

func (*Client) GetOrganizations

func (client *Client) GetOrganizations(ctx context.Context, filters ...OrganizationFilter) ([]Organization, error)

func (*Client) GetSnapshotsFromVolume added in v0.1.8

func (c *Client) GetSnapshotsFromVolume(ctx context.Context, volID string) ([]VolumeSnapshot, error)

func (*Client) GetWireGuardPeer

func (c *Client) GetWireGuardPeer(ctx context.Context, slug, name string) (*WireGuardPeer, error)

func (*Client) GetWireGuardPeers

func (c *Client) GetWireGuardPeers(ctx context.Context, slug string) ([]*WireGuardPeer, error)

func (*Client) ImportDNSRecords

func (c *Client) ImportDNSRecords(ctx context.Context, domainId string, zonefile string) ([]ImportDnsWarning, []ImportDnsChange, error)

func (*Client) IssueSSHCertificate

func (c *Client) IssueSSHCertificate(ctx context.Context, org OrganizationImpl, principals []string, appNames []string, valid_hours *int, publicKey ed25519.PublicKey) (*IssuedCertificate, error)

func (*Client) LatestImage added in v0.1.13

func (c *Client) LatestImage(ctx context.Context, appName string) (string, error)

func (*Client) ListPostgresClusterAttachments

func (client *Client) ListPostgresClusterAttachments(ctx context.Context, appName, postgresAppName string) ([]*PostgresClusterAttachment, error)

func (*Client) LockApp added in v0.1.29

func (client *Client) LockApp(ctx context.Context, input LockAppInput) (*LockApp, error)

func (*Client) Logger

func (c *Client) Logger() Logger

func (*Client) MoveApp

func (client *Client) MoveApp(ctx context.Context, appName string, orgID string) (*App, error)

func (*Client) NewRequest

func (*Client) NewRequest(q string) *graphql.Request

NewRequest - creates a new GraphQL request

func (*Client) PlatformRegions

func (c *Client) PlatformRegions(ctx context.Context) ([]Region, *Region, error)

func (*Client) ReleaseEgressIPAddress added in v0.1.31

func (c *Client) ReleaseEgressIPAddress(ctx context.Context, appName, machineID string) (net.IP, net.IP, error)

func (*Client) ReleaseIPAddress

func (c *Client) ReleaseIPAddress(ctx context.Context, appName string, ip string) error

func (*Client) RemoveWireGuardPeer

func (c *Client) RemoveWireGuardPeer(ctx context.Context, org *Organization, name string) error

func (*Client) ResolveImageForApp

func (client *Client) ResolveImageForApp(ctx context.Context, appName, imageRef string) (*Image, error)

func (*Client) RevokeLimitedAccessToken

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

func (*Client) Run

func (c *Client) Run(req *graphql.Request) (Query, error)

Run - Runs a GraphQL request

func (*Client) RunWithContext

func (c *Client) RunWithContext(ctx context.Context, req *graphql.Request) (Query, error)

RunWithContext - Runs a GraphQL request within a Go context

func (*Client) SetGenqClient added in v0.1.12

func (c *Client) SetGenqClient(client genq.Client)

func (*Client) SetSecrets

func (c *Client) SetSecrets(ctx context.Context, appName string, secrets map[string]string) (*Release, error)

func (*Client) UnlockApp added in v0.1.29

func (client *Client) UnlockApp(ctx context.Context, input UnlockAppInput) (*App, error)

func (*Client) UnsetSecrets

func (c *Client) UnsetSecrets(ctx context.Context, appName string, keys []string) (*Release, error)

func (*Client) UpdateRelease added in v0.1.13

func (c *Client) UpdateRelease(ctx context.Context, input UpdateReleaseInput) (*UpdateReleaseResponse, error)

func (*Client) ValidateWireGuardPeers

func (c *Client) ValidateWireGuardPeers(ctx context.Context, peerIPs []string) (invalid []string, err error)

type ClientOptions

type ClientOptions struct {
	AccessToken      string
	Tokens           *tokens.Tokens
	Name             string
	Version          string
	BaseURL          string
	Logger           Logger
	EnableDebugTrace *bool
	Transport        *Transport
}

type ConsulCheckStatus

type ConsulCheckStatus string
const (
	Critical ConsulCheckStatus = "critical"
	Warning  ConsulCheckStatus = "warning"
	Passing  ConsulCheckStatus = "passing"
)

type CreateAppInput

type CreateAppInput struct {
	OrganizationID  string  `json:"organizationId"`
	Name            string  `json:"name"`
	PreferredRegion *string `json:"preferredRegion,omitempty"`
	Network         *string `json:"network,omitempty"`
	AppRoleID       string  `json:"appRoleId,omitempty"`
	Machines        bool    `json:"machines"`
}

type CreateBuildCreateBuildCreateBuildPayload added in v0.1.13

type CreateBuildCreateBuildCreateBuildPayload struct {
	// build id
	Id string `json:"id"`
	// stored build status
	Status string `json:"status"`
}

CreateBuildCreateBuildCreateBuildPayload includes the requested fields of the GraphQL type CreateBuildPayload. The GraphQL type's documentation follows.

Autogenerated return type of CreateBuild.

func (*CreateBuildCreateBuildCreateBuildPayload) GetId added in v0.1.13

GetId returns CreateBuildCreateBuildCreateBuildPayload.Id, and is useful for accessing the field via an interface.

func (*CreateBuildCreateBuildCreateBuildPayload) GetStatus added in v0.1.13

GetStatus returns CreateBuildCreateBuildCreateBuildPayload.Status, and is useful for accessing the field via an interface.

type CreateBuildInput added in v0.1.13

type CreateBuildInput struct {
	// The name of the app being built
	AppName string `json:"appName"`
	// The kind of builder being used
	BuilderType string `json:"builderType"`
	// A unique identifier for the client performing the mutation.
	ClientMutationId string `json:"clientMutationId"`
	// Options set for building image
	ImageOpts BuildImageOptsInput `json:"imageOpts"`
	// The ID of the machine being built (only set for machine builds)
	MachineId string `json:"machineId"`
	// List of available build strategies that will be attempted
	StrategiesAvailable []string `json:"strategiesAvailable"`
}

Autogenerated input type of CreateBuild

func (*CreateBuildInput) GetAppName added in v0.1.13

func (v *CreateBuildInput) GetAppName() string

GetAppName returns CreateBuildInput.AppName, and is useful for accessing the field via an interface.

func (*CreateBuildInput) GetBuilderType added in v0.1.13

func (v *CreateBuildInput) GetBuilderType() string

GetBuilderType returns CreateBuildInput.BuilderType, and is useful for accessing the field via an interface.

func (*CreateBuildInput) GetClientMutationId added in v0.1.13

func (v *CreateBuildInput) GetClientMutationId() string

GetClientMutationId returns CreateBuildInput.ClientMutationId, and is useful for accessing the field via an interface.

func (*CreateBuildInput) GetImageOpts added in v0.1.13

func (v *CreateBuildInput) GetImageOpts() BuildImageOptsInput

GetImageOpts returns CreateBuildInput.ImageOpts, and is useful for accessing the field via an interface.

func (*CreateBuildInput) GetMachineId added in v0.1.13

func (v *CreateBuildInput) GetMachineId() string

GetMachineId returns CreateBuildInput.MachineId, and is useful for accessing the field via an interface.

func (*CreateBuildInput) GetStrategiesAvailable added in v0.1.13

func (v *CreateBuildInput) GetStrategiesAvailable() []string

GetStrategiesAvailable returns CreateBuildInput.StrategiesAvailable, and is useful for accessing the field via an interface.

type CreateBuildResponse added in v0.1.13

type CreateBuildResponse struct {
	CreateBuild CreateBuildCreateBuildCreateBuildPayload `json:"createBuild"`
}

CreateBuildResponse is returned by CreateBuild on success.

func CreateBuild added in v0.1.13

func CreateBuild(
	ctx_ context.Context,
	client_ graphql.Client,
	input CreateBuildInput,
) (data_ *CreateBuildResponse, err_ error)

func (*CreateBuildResponse) GetCreateBuild added in v0.1.13

GetCreateBuild returns CreateBuildResponse.CreateBuild, and is useful for accessing the field via an interface.

type CreateOrganizationInvitation

type CreateOrganizationInvitation struct {
	Invitation Invitation
}

type CreateOrganizationPayload

type CreateOrganizationPayload struct {
	Organization Organization
}

type CreateReleaseCreateReleaseCreateReleasePayload added in v0.1.13

type CreateReleaseCreateReleaseCreateReleasePayload struct {
	Release CreateReleaseCreateReleaseCreateReleasePayloadRelease `json:"release"`
}

CreateReleaseCreateReleaseCreateReleasePayload includes the requested fields of the GraphQL type CreateReleasePayload. The GraphQL type's documentation follows.

Autogenerated return type of CreateRelease.

func (*CreateReleaseCreateReleaseCreateReleasePayload) GetRelease added in v0.1.13

GetRelease returns CreateReleaseCreateReleaseCreateReleasePayload.Release, and is useful for accessing the field via an interface.

type CreateReleaseCreateReleaseCreateReleasePayloadRelease added in v0.1.13

type CreateReleaseCreateReleaseCreateReleasePayloadRelease struct {
	// Unique ID
	Id string `json:"id"`
	// The version of the release
	Version int `json:"version"`
}

CreateReleaseCreateReleaseCreateReleasePayloadRelease includes the requested fields of the GraphQL type Release.

func (*CreateReleaseCreateReleaseCreateReleasePayloadRelease) GetId added in v0.1.13

GetId returns CreateReleaseCreateReleaseCreateReleasePayloadRelease.Id, and is useful for accessing the field via an interface.

func (*CreateReleaseCreateReleaseCreateReleasePayloadRelease) GetVersion added in v0.1.13

GetVersion returns CreateReleaseCreateReleaseCreateReleasePayloadRelease.Version, and is useful for accessing the field via an interface.

type CreateReleaseInput added in v0.1.13

type CreateReleaseInput struct {
	// The ID of the app
	AppId string `json:"appId"`
	// The build ID linked to the release
	BuildId string `json:"buildId"`
	// A unique identifier for the client performing the mutation.
	ClientMutationId string `json:"clientMutationId"`
	// app definition
	Definition interface{} `json:"definition"`
	// The image to deploy
	Image string `json:"image"`
	// nomad or machines
	PlatformVersion string `json:"platformVersion"`
	// The strategy for replacing existing instances. Defaults to canary.
	Strategy DeploymentStrategy `json:"strategy"`
}

Autogenerated input type of CreateRelease

func (*CreateReleaseInput) GetAppId added in v0.1.13

func (v *CreateReleaseInput) GetAppId() string

GetAppId returns CreateReleaseInput.AppId, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetBuildId added in v0.1.22

func (v *CreateReleaseInput) GetBuildId() string

GetBuildId returns CreateReleaseInput.BuildId, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetClientMutationId added in v0.1.13

func (v *CreateReleaseInput) GetClientMutationId() string

GetClientMutationId returns CreateReleaseInput.ClientMutationId, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetDefinition added in v0.1.13

func (v *CreateReleaseInput) GetDefinition() interface{}

GetDefinition returns CreateReleaseInput.Definition, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetImage added in v0.1.13

func (v *CreateReleaseInput) GetImage() string

GetImage returns CreateReleaseInput.Image, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetPlatformVersion added in v0.1.13

func (v *CreateReleaseInput) GetPlatformVersion() string

GetPlatformVersion returns CreateReleaseInput.PlatformVersion, and is useful for accessing the field via an interface.

func (*CreateReleaseInput) GetStrategy added in v0.1.13

func (v *CreateReleaseInput) GetStrategy() DeploymentStrategy

GetStrategy returns CreateReleaseInput.Strategy, and is useful for accessing the field via an interface.

type CreateReleaseResponse added in v0.1.13

type CreateReleaseResponse struct {
	CreateRelease CreateReleaseCreateReleaseCreateReleasePayload `json:"createRelease"`
}

CreateReleaseResponse is returned by CreateRelease on success.

func CreateRelease added in v0.1.13

func CreateRelease(
	ctx_ context.Context,
	client_ graphql.Client,
	input CreateReleaseInput,
) (data_ *CreateReleaseResponse, err_ error)

func (*CreateReleaseResponse) GetCreateRelease added in v0.1.13

GetCreateRelease returns CreateReleaseResponse.CreateRelease, and is useful for accessing the field via an interface.

type CreateSecretRequest added in v0.1.28

type CreateSecretRequest struct {
	Value []byte `json:"value,omitempty"`
}

type CreateVolumeRequest

type CreateVolumeRequest struct {
	Name              string `json:"name"`
	Region            string `json:"region"`
	SizeGb            *int   `json:"size_gb"`
	Encrypted         *bool  `json:"encrypted"`
	RequireUniqueZone *bool  `json:"require_unique_zone"`
	SnapshotRetention *int   `json:"snapshot_retention"`
	AutoBackupEnabled *bool  `json:"auto_backup_enabled"`

	// FSType sets the filesystem of this volume. The valid values are "ext4" and "raw".
	// Not setting the value results "ext4".
	FSType *string `json:"fstype"`

	// restore from snapshot
	SnapshotID *string `json:"snapshot_id"`
	// fork from remote volume
	SourceVolumeID *string `json:"source_volume_id"`

	// If the volume is going to be attached to a new machine, make the placement logic aware of it
	ComputeRequirements *MachineGuest `json:"compute"`
	ComputeImage        string        `json:"compute_image,omitempty"`
}

type CreatedWireGuardPeer

type CreatedWireGuardPeer struct {
	Peerip     string `json:"peerip"`
	Endpointip string `json:"endpointip"`
	Pubkey     string `json:"pubkey"`
}

type DNSConfig

type DNSConfig struct {
	SkipRegistration bool             `json:"skip_registration,omitempty"`
	Nameservers      []string         `json:"nameservers,omitempty"`
	Searches         []string         `json:"searches,omitempty"`
	Options          []dnsOption      `json:"options,omitempty"`
	DNSForwardRules  []dnsForwardRule `json:"dns_forward_rules,omitempty"`
	Hostname         string           `json:"hostname,omitempty"`
	HostnameFqdn     string           `json:"hostname_fqdn,omitempty"`
}

type DNSRecord

type DNSRecord struct {
	ID         string
	Name       string
	FQDN       string
	IsApex     bool
	IsWildcard bool
	IsSystem   bool
	TTL        int
	Type       string
	RData      string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type DNSRecords

type DNSRecords struct {
	ID         string
	Name       string
	Ttl        int
	Values     []string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Fqdn       string
	IsApex     bool
	IsSystem   bool
	IsWildcard bool
	Domain     *Domain
}

type Definition

type Definition map[string]interface{}

func DefinitionPtr

func DefinitionPtr(in map[string]interface{}) *Definition

type DelegatedWireGuardToken

type DelegatedWireGuardToken struct {
	Token string
}

type DelegatedWireGuardTokenHandle

type DelegatedWireGuardTokenHandle struct {
	Name string
}

type DeleteCertificatePayload

type DeleteCertificatePayload struct {
	App         App
	Certificate AppCertificate
}

type DeleteOrganizationMembershipPayload

type DeleteOrganizationMembershipPayload struct {
	Organization *Organization
	User         *User
}

type DeleteOrganizationPayload

type DeleteOrganizationPayload struct {
	DeletedOrganizationId string
}

type DeploymentStrategy added in v0.1.13

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 DetachPostgresClusterInput

type DetachPostgresClusterInput struct {
	AppID                       string `json:"appId"`
	PostgresClusterId           string `json:"postgresClusterAppId"`
	PostgresClusterAttachmentId string `json:"postgresClusterAttachmentId"`
}

type Domain

type Domain struct {
	ID                   string
	Name                 string
	CreatedAt            time.Time
	Organization         *Organization
	AutoRenew            *bool
	DelegatedNameservers *[]string
	ZoneNameservers      *[]string
	DnsStatus            *string
	RegistrationStatus   *string
	ExpiresAt            time.Time
	DnsRecords           *struct {
		Nodes *[]*DNSRecord
	}
}

type Duration

type Duration struct {
	time.Duration
}

func MustParseDuration

func MustParseDuration(v any) *Duration

MustParseDuration is like ParseDuration but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding durations Same idea than regexp.MustCompile

func ParseDuration

func ParseDuration(v any) (*Duration, error)

Compile parses a duration and returns, if successful, a Duration object.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalTOML

func (d Duration) MarshalTOML() ([]byte, error)

func (*Duration) MarshalText

func (d *Duration) MarshalText() ([]byte, error)

func (*Duration) ParseDuration

func (d *Duration) ParseDuration(v any) error

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

func (*Duration) UnmarshalTOML

func (d *Duration) UnmarshalTOML(v any) error

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type EgressIPAddress added in v0.1.29

type EgressIPAddress struct {
	ID      string
	IP      string
	Version int
	Region  string
}

type EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload added in v0.1.19

type EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload struct {
	BuildId    *string `json:"buildId"`
	BuildToken *string `json:"buildToken"`
}

EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload includes the requested fields of the GraphQL type EnsureDepotRemoteBuilderPayload. The GraphQL type's documentation follows.

Autogenerated return type of EnsureDepotRemoteBuilder.

func (*EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload) GetBuildId added in v0.1.19

GetBuildId returns EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload.BuildId, and is useful for accessing the field via an interface.

func (*EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload) GetBuildToken added in v0.1.19

GetBuildToken returns EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload.BuildToken, and is useful for accessing the field via an interface.

type EnsureDepotRemoteBuilderInput added in v0.1.19

type EnsureDepotRemoteBuilderInput struct {
	// The unique application name
	AppName *string `json:"appName"`
	// The scope of the builder; either "app" or "organization"
	BuilderScope *string `json:"builderScope"`
	// A unique identifier for the client performing the mutation.
	ClientMutationId *string `json:"clientMutationId"`
	// The node ID of the organization
	OrganizationId *string `json:"organizationId"`
	// Desired region for the remote builder
	Region *string `json:"region"`
}

Autogenerated input type of EnsureDepotRemoteBuilder

func (*EnsureDepotRemoteBuilderInput) GetAppName added in v0.1.19

func (v *EnsureDepotRemoteBuilderInput) GetAppName() *string

GetAppName returns EnsureDepotRemoteBuilderInput.AppName, and is useful for accessing the field via an interface.

func (*EnsureDepotRemoteBuilderInput) GetBuilderScope added in v0.1.26

func (v *EnsureDepotRemoteBuilderInput) GetBuilderScope() *string

GetBuilderScope returns EnsureDepotRemoteBuilderInput.BuilderScope, and is useful for accessing the field via an interface.

func (*EnsureDepotRemoteBuilderInput) GetClientMutationId added in v0.1.19

func (v *EnsureDepotRemoteBuilderInput) GetClientMutationId() *string

GetClientMutationId returns EnsureDepotRemoteBuilderInput.ClientMutationId, and is useful for accessing the field via an interface.

func (*EnsureDepotRemoteBuilderInput) GetOrganizationId added in v0.1.19

func (v *EnsureDepotRemoteBuilderInput) GetOrganizationId() *string

GetOrganizationId returns EnsureDepotRemoteBuilderInput.OrganizationId, and is useful for accessing the field via an interface.

func (*EnsureDepotRemoteBuilderInput) GetRegion added in v0.1.19

func (v *EnsureDepotRemoteBuilderInput) GetRegion() *string

GetRegion returns EnsureDepotRemoteBuilderInput.Region, and is useful for accessing the field via an interface.

type EnsureDepotRemoteBuilderResponse added in v0.1.19

type EnsureDepotRemoteBuilderResponse struct {
	EnsureDepotRemoteBuilder *EnsureDepotRemoteBuilderEnsureDepotRemoteBuilderEnsureDepotRemoteBuilderPayload `json:"ensureDepotRemoteBuilder"`
}

EnsureDepotRemoteBuilderResponse is returned by EnsureDepotRemoteBuilder on success.

func EnsureDepotRemoteBuilder added in v0.1.19

func EnsureDepotRemoteBuilder(
	ctx_ context.Context,
	client_ graphql.Client,
	input *EnsureDepotRemoteBuilderInput,
) (data_ *EnsureDepotRemoteBuilderResponse, err_ error)

func (*EnsureDepotRemoteBuilderResponse) GetEnsureDepotRemoteBuilder added in v0.1.19

GetEnsureDepotRemoteBuilder returns EnsureDepotRemoteBuilderResponse.EnsureDepotRemoteBuilder, and is useful for accessing the field via an interface.

type EnsureRemoteBuilderInput

type EnsureRemoteBuilderInput struct {
	AppName        *string `json:"appName"`
	OrganizationID *string `json:"organizationId"`
	Region         *string `json:"region"`
}

type EnvFrom

type EnvFrom struct {
	// EnvVar is required and is the name of the environment variable that will be set from the
	// secret. It must be a valid environment variable name.
	EnvVar string `json:"env_var"`

	// FieldRef selects a field of the Machine: supports id, version, app_name, private_ip, region, image.
	FieldRef string `json:"field_ref" enums:"id,version,app_name,private_ip,region,image"`
}

@description EnvVar defines an environment variable to be populated from a machine field, env_var and field_ref are required.

type Error

type Error struct {
	Message    string
	Path       []string
	Extensions Extensions
}

type Errors

type Errors []Error

type Extensions

type Extensions struct {
	Code        string
	ServiceName string
	Query       string
	Variables   map[string]string
}

type File

type File struct {
	// GuestPath is the path on the machine where the file will be written and must be an absolute path.
	// For example: /full/path/to/file.json
	GuestPath string `json:"guest_path,omitempty"`

	// The base64 encoded string of the file contents.
	RawValue *string `json:"raw_value,omitempty"`

	// The name of the secret that contains the base64 encoded file contents.
	SecretName *string `json:"secret_name,omitempty"`

	// Mode bits used to set permissions on this file as accepted by chmod(2).
	Mode uint32 `json:"mode,omitempty"`
}

@description A file that will be written to the Machine. One of RawValue or SecretName must be set.

type FinishBuildFinishBuildFinishBuildPayload added in v0.1.13

type FinishBuildFinishBuildFinishBuildPayload struct {
	// build id
	Id string `json:"id"`
	// stored build status
	Status string `json:"status"`
	// wall clock time for this build
	WallclockTimeMs int `json:"wallclockTimeMs"`
}

FinishBuildFinishBuildFinishBuildPayload includes the requested fields of the GraphQL type FinishBuildPayload. The GraphQL type's documentation follows.

Autogenerated return type of FinishBuild.

func (*FinishBuildFinishBuildFinishBuildPayload) GetId added in v0.1.13

GetId returns FinishBuildFinishBuildFinishBuildPayload.Id, and is useful for accessing the field via an interface.

func (*FinishBuildFinishBuildFinishBuildPayload) GetStatus added in v0.1.13

GetStatus returns FinishBuildFinishBuildFinishBuildPayload.Status, and is useful for accessing the field via an interface.

func (*FinishBuildFinishBuildFinishBuildPayload) GetWallclockTimeMs added in v0.1.13

func (v *FinishBuildFinishBuildFinishBuildPayload) GetWallclockTimeMs() int

GetWallclockTimeMs returns FinishBuildFinishBuildFinishBuildPayload.WallclockTimeMs, and is useful for accessing the field via an interface.

type FinishBuildInput added in v0.1.13

type FinishBuildInput struct {
	// The name of the app being built
	AppName string `json:"appName"`
	// Build id returned by createBuild() mutation
	BuildId string `json:"buildId"`
	// Metadata about the builder
	BuilderMeta BuilderMetaInput `json:"builderMeta"`
	// A unique identifier for the client performing the mutation.
	ClientMutationId string `json:"clientMutationId"`
	// Information about the docker image that was built
	FinalImage BuildFinalImageInput `json:"finalImage"`
	// Log or error output
	Logs string `json:"logs"`
	// The ID of the machine being built (only set for machine builds)
	MachineId string `json:"machineId"`
	// Indicate whether build completed or failed
	Status string `json:"status"`
	// Build strategies attempted and their result, should be in order of attempt
	StrategiesAttempted []BuildStrategyAttemptInput `json:"strategiesAttempted"`
	// Timings for different phases of the build
	Timings BuildTimingsInput `json:"timings"`
}

Autogenerated input type of FinishBuild

func (*FinishBuildInput) GetAppName added in v0.1.13

func (v *FinishBuildInput) GetAppName() string

GetAppName returns FinishBuildInput.AppName, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetBuildId added in v0.1.13

func (v *FinishBuildInput) GetBuildId() string

GetBuildId returns FinishBuildInput.BuildId, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetBuilderMeta added in v0.1.13

func (v *FinishBuildInput) GetBuilderMeta() BuilderMetaInput

GetBuilderMeta returns FinishBuildInput.BuilderMeta, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetClientMutationId added in v0.1.13

func (v *FinishBuildInput) GetClientMutationId() string

GetClientMutationId returns FinishBuildInput.ClientMutationId, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetFinalImage added in v0.1.13

func (v *FinishBuildInput) GetFinalImage() BuildFinalImageInput

GetFinalImage returns FinishBuildInput.FinalImage, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetLogs added in v0.1.13

func (v *FinishBuildInput) GetLogs() string

GetLogs returns FinishBuildInput.Logs, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetMachineId added in v0.1.13

func (v *FinishBuildInput) GetMachineId() string

GetMachineId returns FinishBuildInput.MachineId, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetStatus added in v0.1.13

func (v *FinishBuildInput) GetStatus() string

GetStatus returns FinishBuildInput.Status, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetStrategiesAttempted added in v0.1.13

func (v *FinishBuildInput) GetStrategiesAttempted() []BuildStrategyAttemptInput

GetStrategiesAttempted returns FinishBuildInput.StrategiesAttempted, and is useful for accessing the field via an interface.

func (*FinishBuildInput) GetTimings added in v0.1.13

func (v *FinishBuildInput) GetTimings() BuildTimingsInput

GetTimings returns FinishBuildInput.Timings, and is useful for accessing the field via an interface.

type FinishBuildResponse added in v0.1.13

type FinishBuildResponse struct {
	FinishBuild FinishBuildFinishBuildFinishBuildPayload `json:"finishBuild"`
}

FinishBuildResponse is returned by FinishBuild on success.

func FinishBuild added in v0.1.13

func FinishBuild(
	ctx_ context.Context,
	client_ graphql.Client,
	input FinishBuildInput,
) (data_ *FinishBuildResponse, err_ error)

func (*FinishBuildResponse) GetFinishBuild added in v0.1.13

GetFinishBuild returns FinishBuildResponse.FinishBuild, and is useful for accessing the field via an interface.

type GqlMachine

type GqlMachine struct {
	ID     string
	Name   string
	State  string
	Region string
	Config MachineConfig

	App *AppCompact

	IPs struct {
		Nodes []*MachineIP
	}

	EgressIpAddresses struct {
		Nodes []*EgressIPAddress
	}
}

type HTTPOptions

type HTTPOptions struct {
	Compress           *bool                `json:"compress,omitempty" toml:"compress,omitempty"`
	Response           *HTTPResponseOptions `json:"response,omitempty" toml:"response,omitempty"`
	H2Backend          *bool                `json:"h2_backend,omitempty" toml:"h2_backend,omitempty"`
	IdleTimeout        *uint32              `json:"idle_timeout,omitempty" toml:"idle_timeout,omitempty"`
	HeadersReadTimeout *uint32              `json:"headers_read_timeout,omitempty" toml:"headers_read_timeout,omitempty"`
}

type HTTPResponseOptions

type HTTPResponseOptions struct {
	Headers  map[string]any `json:"headers,omitempty" toml:"headers,omitempty"`
	Pristine *bool          `json:"pristine,omitempty" toml:"pristine,omitempty"`
}

type HealthCheckStatus

type HealthCheckStatus struct {
	Total, Passing, Warn, Critical int
}

func (*HealthCheckStatus) AllPassing

func (hcs *HealthCheckStatus) AllPassing() bool

type HostIssue added in v0.1.14

type HostIssue struct {
	InternalId string
	Message    string
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type HostStatus added in v0.1.24

type HostStatus string
var (
	HostStatusOk          HostStatus = "ok"
	HostStatusUnknown     HostStatus = "unknown"
	HostStatusUnreachable HostStatus = "unreachable"
)

type HostnameCheck

type HostnameCheck struct {
	ARecords              []string `json:"aRecords"`
	AAAARecords           []string `json:"aaaaRecords"`
	CNAMERecords          []string `json:"cnameRecords"`
	SOA                   string   `json:"soa"`
	DNSProvider           string   `json:"dnsProvider"`
	DNSVerificationRecord string   `json:"dnsVerificationRecord"`
	ResolvedAddresses     []string `json:"resolvedAddresses"`
}

type IPAddress

type IPAddress struct {
	ID          string
	Address     string
	Type        string
	Region      string
	CreatedAt   time.Time
	ServiceName string
	Network     *struct {
		Name         string
		Organization *struct {
			Slug string
		}
	}
}

type Image

type Image struct {
	ID             string
	Digest         string
	Ref            string
	CompressedSize string
}

type ImageVersion

type ImageVersion struct {
	Registry   string
	Repository string
	Tag        string
	Version    string
	Digest     string
}

func (*ImageVersion) FullImageRef

func (img *ImageVersion) FullImageRef() string

type ImportDnsChange

type ImportDnsChange struct {
	Action  string
	OldText string
	NewText string
}

type ImportDnsWarning

type ImportDnsWarning struct {
	Action     string
	Attributes struct {
		Name  string
		Type  string
		TTL   int
		Rdata string
	}
	Message string
}

type InstrumentationService

type InstrumentationService interface {
	ReportCallTiming(duration time.Duration)
}

type Invitation

type Invitation struct {
	ID           string
	Email        string
	CreatedAt    time.Time
	Redeemed     bool
	Inviter      *User
	Organization *Organization
}

type IssuedCertificate

type IssuedCertificate struct {
	Certificate string
	Key         string
}

type LatestImageApp added in v0.1.13

type LatestImageApp struct {
	// The latest release of this application, without any config processing
	CurrentReleaseUnprocessed LatestImageAppCurrentReleaseUnprocessed `json:"currentReleaseUnprocessed"`
}

LatestImageApp includes the requested fields of the GraphQL type App.

func (*LatestImageApp) GetCurrentReleaseUnprocessed added in v0.1.13

func (v *LatestImageApp) GetCurrentReleaseUnprocessed() LatestImageAppCurrentReleaseUnprocessed

GetCurrentReleaseUnprocessed returns LatestImageApp.CurrentReleaseUnprocessed, and is useful for accessing the field via an interface.

type LatestImageAppCurrentReleaseUnprocessed added in v0.1.13

type LatestImageAppCurrentReleaseUnprocessed struct {
	// Unique ID
	Id string `json:"id"`
	// The version of the release
	Version int `json:"version"`
	// Docker image URI
	ImageRef string `json:"imageRef"`
}

LatestImageAppCurrentReleaseUnprocessed includes the requested fields of the GraphQL type ReleaseUnprocessed.

func (*LatestImageAppCurrentReleaseUnprocessed) GetId added in v0.1.13

GetId returns LatestImageAppCurrentReleaseUnprocessed.Id, and is useful for accessing the field via an interface.

func (*LatestImageAppCurrentReleaseUnprocessed) GetImageRef added in v0.1.13

GetImageRef returns LatestImageAppCurrentReleaseUnprocessed.ImageRef, and is useful for accessing the field via an interface.

func (*LatestImageAppCurrentReleaseUnprocessed) GetVersion added in v0.1.13

GetVersion returns LatestImageAppCurrentReleaseUnprocessed.Version, and is useful for accessing the field via an interface.

type LatestImageResponse added in v0.1.13

type LatestImageResponse struct {
	// Find an app by name
	App LatestImageApp `json:"app"`
}

LatestImageResponse is returned by LatestImage on success.

func LatestImage added in v0.1.13

func LatestImage(
	ctx_ context.Context,
	client_ graphql.Client,
	appName string,
) (data_ *LatestImageResponse, err_ error)

func (*LatestImageResponse) GetApp added in v0.1.13

func (v *LatestImageResponse) GetApp() LatestImageApp

GetApp returns LatestImageResponse.App, and is useful for accessing the field via an interface.

type LaunchMachineInput

type LaunchMachineInput struct {
	Config                  *MachineConfig `json:"config,omitempty"`
	Region                  string         `json:"region,omitempty"`
	Name                    string         `json:"name,omitempty"`
	SkipLaunch              bool           `json:"skip_launch,omitempty"`
	SkipServiceRegistration bool           `json:"skip_service_registration,omitempty"`
	LSVD                    bool           `json:"lsvd,omitempty"`

	LeaseTTL int `json:"lease_ttl,omitempty"`

	// Client side only
	ID                  string `json:"-"`
	SkipHealthChecks    bool   `json:"-"`
	RequiresReplacement bool   `json:"-"`
	Timeout             int    `json:"-"`
}

type LimitedAccessToken

type LimitedAccessToken struct {
	Id        string
	Name      string
	Token     string
	ExpiresAt time.Time
	RevokedAt *time.Time
	User      User
}

type ListSecret added in v0.1.28

type ListSecret struct {
	Label string `json:"label"`
	Type  string `json:"type"`
}

type ListenSocket

type ListenSocket struct {
	Proto   string `json:"proto"`
	Address string `json:"address"`
}

type LockApp added in v0.1.29

type LockApp struct {
	LockID     string `json:"lockId"`
	Expiration time.Time
}

type LockAppInput added in v0.1.29

type LockAppInput struct {
	AppID  string `json:"app_id"`
	LockID string `json:"lock_id"`
}

type LogEntry

type LogEntry struct {
	Timestamp string
	Message   string
	Level     string
	Instance  string
	Region    string
	Meta      struct {
		Instance string
		Region   string
		Event    struct {
			Provider string
		}
		HTTP struct {
			Request struct {
				ID      string
				Method  string
				Version string
			}
			Response struct {
				StatusCode int `json:"status_code"`
			}
		}
		Error struct {
			Code    int
			Message string
		}
		URL struct {
			Full string
		}
	}
}

type LoggedCertificate

type LoggedCertificate struct {
	Root bool
	Cert string
}

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})
}

type LoggingTransport

type LoggingTransport struct {
	InnerTransport http.RoundTripper
	Logger         Logger
	// contains filtered or unexported fields
}

func (*LoggingTransport) RoundTrip

func (t *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Machine

type Machine struct {
	ID       string          `json:"id,omitempty"`
	Name     string          `json:"name,omitempty"`
	State    string          `json:"state,omitempty"`
	Region   string          `json:"region,omitempty"`
	ImageRef MachineImageRef `json:"image_ref,omitempty"`
	// InstanceID is unique for each version of the machine
	InstanceID string `json:"instance_id,omitempty"`
	Version    string `json:"version,omitempty"`
	// PrivateIP is the internal 6PN address of the machine.
	PrivateIP  string                `json:"private_ip,omitempty"`
	CreatedAt  string                `json:"created_at,omitempty"`
	UpdatedAt  string                `json:"updated_at,omitempty"`
	Config     *MachineConfig        `json:"config,omitempty"`
	Events     []*MachineEvent       `json:"events,omitempty"`
	Checks     []*MachineCheckStatus `json:"checks,omitempty"`
	LeaseNonce string                `json:"nonce,omitempty"`
	HostStatus HostStatus            `json:"host_status,omitempty" enums:"ok,unknown,unreachable"`

	// When `host_status` isn't "ok", the config can't be fully retrieved and has to be rebuilt from multiple sources
	// to form an partial configuration, not suitable to clone or recreate the original machine
	IncompleteConfig *MachineConfig `json:"incomplete_config,omitempty"`
}

func (*Machine) AllHealthChecks

func (m *Machine) AllHealthChecks() *HealthCheckStatus

func (*Machine) FullImageRef

func (m *Machine) FullImageRef() string

func (*Machine) GetConfig added in v0.1.25

func (m *Machine) GetConfig() *MachineConfig

GetConfig returns `IncompleteConfig` if `Config` is unset which happens when `HostStatus` isn't "ok"

func (*Machine) GetLatestEventOfType added in v0.1.5

func (m *Machine) GetLatestEventOfType(eventType string) *MachineEvent

func (*Machine) GetLatestEventOfTypeAfterType

func (m *Machine) GetLatestEventOfTypeAfterType(latestEventType, firstEventType string) *MachineEvent

Finds the latest event of type latestEventType, which happened after the most recent event of type firstEventType

func (*Machine) GetMetadataByKey added in v0.1.25

func (m *Machine) GetMetadataByKey(key string) string

func (*Machine) HasProcessGroup

func (m *Machine) HasProcessGroup(desired string) bool

func (*Machine) ImageRefWithVersion

func (m *Machine) ImageRefWithVersion() string

func (*Machine) ImageRepository

func (m *Machine) ImageRepository() string

func (*Machine) ImageVersion

func (m *Machine) ImageVersion() string

func (*Machine) IsActive

func (m *Machine) IsActive() bool

func (*Machine) IsAppsV2

func (m *Machine) IsAppsV2() bool

func (*Machine) IsFlyAppsConsole

func (m *Machine) IsFlyAppsConsole() bool

func (*Machine) IsFlyAppsPlatform

func (m *Machine) IsFlyAppsPlatform() bool

func (*Machine) IsFlyAppsReleaseCommand

func (m *Machine) IsFlyAppsReleaseCommand() bool

func (*Machine) IsReleaseCommandMachine

func (m *Machine) IsReleaseCommandMachine() bool

func (*Machine) MostRecentStartTimeAfterLaunch

func (m *Machine) MostRecentStartTimeAfterLaunch() (time.Time, error)

func (*Machine) ProcessGroup

func (m *Machine) ProcessGroup() string

func (*Machine) TopLevelChecks

func (m *Machine) TopLevelChecks() *HealthCheckStatus

type MachineAutostop added in v0.1.19

type MachineAutostop int
const (
	MachineAutostopOff MachineAutostop = iota
	MachineAutostopStop
	MachineAutostopSuspend
)

func (MachineAutostop) MarshalJSON added in v0.1.19

func (s MachineAutostop) MarshalJSON() ([]byte, error)

func (MachineAutostop) MarshalText added in v0.1.19

func (s MachineAutostop) MarshalText() ([]byte, error)

func (MachineAutostop) String added in v0.1.19

func (s MachineAutostop) String() string

func (*MachineAutostop) UnmarshalJSON added in v0.1.19

func (s *MachineAutostop) UnmarshalJSON(raw []byte) error

func (*MachineAutostop) UnmarshalText added in v0.1.19

func (s *MachineAutostop) UnmarshalText(raw []byte) error

type MachineCheck

type MachineCheck struct {
	// The port to connect to, often the same as internal_port
	Port *int `json:"port,omitempty"`
	// tcp or http
	Type *string `json:"type,omitempty"`
	// Kind of the check (informational, readiness)
	Kind *MachineCheckKind `json:"kind,omitempty" enums:"informational,readiness"`
	// The time between connectivity checks
	Interval *Duration `json:"interval,omitempty"`
	// The maximum time a connection can take before being reported as failing its health check
	Timeout *Duration `json:"timeout,omitempty"`
	// The time to wait after a VM starts before checking its health
	GracePeriod *Duration `json:"grace_period,omitempty"`
	// For http checks, the HTTP method to use to when making the request
	HTTPMethod *string `json:"method,omitempty"`
	// For http checks, the path to send the request to
	HTTPPath *string `json:"path,omitempty"`
	// For http checks, whether to use http or https
	HTTPProtocol *string `json:"protocol,omitempty"`
	// For http checks with https protocol, whether or not to verify the TLS certificate
	HTTPSkipTLSVerify *bool `json:"tls_skip_verify,omitempty"`
	// If the protocol is https, the hostname to use for TLS certificate validation
	HTTPTLSServerName *string             `json:"tls_server_name,omitempty"`
	HTTPHeaders       []MachineHTTPHeader `json:"headers,omitempty"`
}

@description An optional object that defines one or more named checks. The key for each check is the check name.

type MachineCheckKind added in v0.1.26

type MachineCheckKind string
var (
	// Informational check. Showed in status, but doesn't cause any actions.
	// Default value for top-level check if kind is not specified.
	MachineCheckKindInformational MachineCheckKind = "informational"
	// Readiness check. Failed check causes the machine to be taken out of LB pool
	MachineCheckKindReadiness MachineCheckKind = "readiness"
)

type MachineCheckStatus

type MachineCheckStatus struct {
	Name      string            `json:"name,omitempty"`
	Status    ConsulCheckStatus `json:"status,omitempty"`
	Output    string            `json:"output,omitempty"`
	UpdatedAt *time.Time        `json:"updated_at,omitempty"`
}

type MachineConfig

type MachineConfig struct {

	// An object filled with key/value pairs to be set as environment variables
	Env      map[string]string       `json:"env,omitempty"`
	Init     MachineInit             `json:"init,omitempty"`
	Guest    *MachineGuest           `json:"guest,omitempty"`
	Metadata map[string]string       `json:"metadata,omitempty"`
	Mounts   []MachineMount          `json:"mounts,omitempty"`
	Services []MachineService        `json:"services,omitempty"`
	Metrics  *MachineMetrics         `json:"metrics,omitempty"`
	Checks   map[string]MachineCheck `json:"checks,omitempty"`
	Statics  []*Static               `json:"statics,omitempty"`

	// The docker image to run
	Image string  `json:"image,omitempty"`
	Files []*File `json:"files,omitempty"`

	Schedule string `json:"schedule,omitempty"`
	// Optional boolean telling the Machine to destroy itself once it’s complete (default false)
	AutoDestroy bool             `json:"auto_destroy,omitempty"`
	Restart     *MachineRestart  `json:"restart,omitempty"`
	DNS         *DNSConfig       `json:"dns,omitempty"`
	Processes   []MachineProcess `json:"processes,omitempty"`

	// Standbys enable a machine to be a standby for another. In the event of a hardware failure,
	// the standby machine will be started.
	Standbys []string `json:"standbys,omitempty"`

	StopConfig *StopConfig `json:"stop_config,omitempty"`

	// Deprecated: use Guest instead
	VMSize string `json:"size,omitempty"`
	// Deprecated: use Service.Autostart instead
	DisableMachineAutostart *bool `json:"disable_machine_autostart,omitempty"`
}

func (*MachineConfig) ProcessGroup

func (c *MachineConfig) ProcessGroup() string

type MachineEvent

type MachineEvent struct {
	Type      string          `json:"type,omitempty"`
	Status    string          `json:"status,omitempty"`
	Request   *MachineRequest `json:"request,omitempty"`
	Source    string          `json:"source,omitempty"`
	Timestamp int64           `json:"timestamp,omitempty"`
}

func (*MachineEvent) Time

func (e *MachineEvent) Time() time.Time

type MachineExecRequest

type MachineExecRequest struct {
	Cmd     string `json:"cmd,omitempty"`
	Timeout int    `json:"timeout,omitempty"`
}

type MachineExecResponse

type MachineExecResponse struct {
	ExitCode int32  `json:"exit_code,omitempty"`
	StdOut   string `json:"stdout,omitempty"`
	StdErr   string `json:"stderr,omitempty"`
}

type MachineExitEvent

type MachineExitEvent struct {
	ExitCode      int       `json:"exit_code,omitempty"`
	GuestExitCode int       `json:"guest_exit_code,omitempty"`
	GuestSignal   int       `json:"guest_signal,omitempty"`
	OOMKilled     bool      `json:"oom_killed,omitempty"`
	RequestedStop bool      `json:"requested_stop,omitempty"`
	Restarting    bool      `json:"restarting,omitempty"`
	Signal        int       `json:"signal,omitempty"`
	ExitedAt      time.Time `json:"exited_at,omitempty"`
}

type MachineGuest

type MachineGuest struct {
	CPUKind          string `json:"cpu_kind,omitempty" toml:"cpu_kind,omitempty"`
	CPUs             int    `json:"cpus,omitempty" toml:"cpus,omitempty"`
	MemoryMB         int    `json:"memory_mb,omitempty" toml:"memory_mb,omitempty"`
	GPUs             int    `json:"gpus,omitempty" toml:"gpus,omitempty"`
	GPUKind          string `json:"gpu_kind,omitempty" toml:"gpu_kind,omitempty"`
	HostDedicationID string `json:"host_dedication_id,omitempty" toml:"host_dedication_id,omitempty"`

	KernelArgs []string `json:"kernel_args,omitempty" toml:"kernel_args,omitempty"`
}

func (*MachineGuest) SetSize

func (mg *MachineGuest) SetSize(size string) error

func (*MachineGuest) String

func (mg *MachineGuest) String() string

String returns a string representation of the guest Formatted as "[cpu_kind], XGB RAM" Returns "" if nil

func (*MachineGuest) ToSize

func (mg *MachineGuest) ToSize() string

ToSize converts Guest into VMSize on a best effort way

type MachineHTTPHeader

type MachineHTTPHeader struct {
	// The header name
	Name string `json:"name,omitempty"`
	// The header value
	Values []string `json:"values,omitempty"`
}

@description For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.

type MachineIP

type MachineIP struct {
	Family   string
	Kind     string
	IP       string
	MaskSize int
}

type MachineImageRef

type MachineImageRef struct {
	Registry   string            `json:"registry,omitempty"`
	Repository string            `json:"repository,omitempty"`
	Tag        string            `json:"tag,omitempty"`
	Digest     string            `json:"digest,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
}

type MachineInit

type MachineInit struct {
	Exec       []string `json:"exec,omitempty"`
	Entrypoint []string `json:"entrypoint,omitempty"`
	Cmd        []string `json:"cmd,omitempty"`
	Tty        bool     `json:"tty,omitempty"`
	SwapSizeMB *int     `json:"swap_size_mb,omitempty"`
	KernelArgs []string `json:"kernel_args,omitempty"`
}

type MachineLease

type MachineLease struct {
	Status  string            `json:"status,omitempty"`
	Data    *MachineLeaseData `json:"data,omitempty"`
	Message string            `json:"message,omitempty"`
	Code    string            `json:"code,omitempty"`
}

type MachineLeaseData

type MachineLeaseData struct {
	Nonce     string `json:"nonce,omitempty"`
	ExpiresAt int64  `json:"expires_at,omitempty"`
	Owner     string `json:"owner,omitempty"`
	Version   string `json:"version,omitempty"`
}

type MachineMetrics

type MachineMetrics struct {
	Port  int    `toml:"port" json:"port,omitempty"`
	Path  string `toml:"path" json:"path,omitempty"`
	Https bool   `toml:"https" json:"https,omitempty"`
}

type MachineMonitorEvent

type MachineMonitorEvent struct {
	ExitEvent *MachineExitEvent `json:"exit_event,omitempty"`
}

type MachineMount

type MachineMount struct {
	Encrypted              bool   `json:"encrypted,omitempty"`
	Path                   string `json:"path,omitempty"`
	SizeGb                 int    `json:"size_gb,omitempty"`
	Volume                 string `json:"volume,omitempty"`
	Name                   string `json:"name,omitempty"`
	ExtendThresholdPercent int    `json:"extend_threshold_percent,omitempty"`
	AddSizeGb              int    `json:"add_size_gb,omitempty"`
	SizeGbLimit            int    `json:"size_gb_limit,omitempty"`
}

type MachinePort

type MachinePort struct {
	Port              *int               `json:"port,omitempty" toml:"port,omitempty"`
	StartPort         *int               `json:"start_port,omitempty" toml:"start_port,omitempty"`
	EndPort           *int               `json:"end_port,omitempty" toml:"end_port,omitempty"`
	Handlers          []string           `json:"handlers,omitempty" toml:"handlers,omitempty"`
	ForceHTTPS        bool               `json:"force_https,omitempty" toml:"force_https,omitempty"`
	TLSOptions        *TLSOptions        `json:"tls_options,omitempty" toml:"tls_options,omitempty"`
	HTTPOptions       *HTTPOptions       `json:"http_options,omitempty" toml:"http_options,omitempty"`
	ProxyProtoOptions *ProxyProtoOptions `json:"proxy_proto_options,omitempty" toml:"proxy_proto_options,omitempty"`
}

func (*MachinePort) ContainsPort

func (mp *MachinePort) ContainsPort(port int) bool

func (*MachinePort) HasNonHttpPorts

func (mp *MachinePort) HasNonHttpPorts() bool

type MachineProcess

type MachineProcess struct {
	ExecOverride       []string          `json:"exec,omitempty"`
	EntrypointOverride []string          `json:"entrypoint,omitempty"`
	CmdOverride        []string          `json:"cmd,omitempty"`
	UserOverride       string            `json:"user,omitempty"`
	ExtraEnv           map[string]string `json:"env,omitempty"`
	// Secrets can be provided at the process level to explicitly indicate which secrets should be
	// used for the process. If not provided, the secrets provided at the machine level will be used.
	Secrets []MachineSecret `json:"secrets,omitempty"`
	// IgnoreAppSecrets can be set to true to ignore the secrets for the App the Machine belongs to
	// and only use the secrets provided at the process level. The default/legacy behavior is to use
	// the secrets provided at the App level.
	IgnoreAppSecrets bool `json:"ignore_app_secrets,omitempty"`

	// EnvFrom can be provided to set environment variables from machine fields.
	EnvFrom []EnvFrom `json:"env_from,omitempty"`
}

type MachinePsResponse

type MachinePsResponse []ProcessStat

type MachineRequest

type MachineRequest struct {
	ExitEvent    *MachineExitEvent    `json:"exit_event,omitempty"`
	MonitorEvent *MachineMonitorEvent `json:"MonitorEvent,omitempty"`
	RestartCount int                  `json:"restart_count,omitempty"`
}

func (*MachineRequest) GetExitCode

func (mr *MachineRequest) GetExitCode() (int, error)

returns the ExitCode from MonitorEvent if it exists, otherwise ExitEvent error when MonitorEvent and ExitEvent are both nil

type MachineRestart

type MachineRestart struct {
	// * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash.
	// * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly.
	// * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules.
	// * spot-price - Starts the Machine only when there is capacity and the spot price is less than or equal to the bid price.
	Policy MachineRestartPolicy `json:"policy,omitempty" enums:"no,always,on-failure,spot-price"`
	// When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop.
	MaxRetries int `json:"max_retries,omitempty"`
	// GPU bid price for spot Machines.
	GPUBidPrice float32 `json:"gpu_bid_price,omitempty"`
}

@description The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.

type MachineRestartPolicy

type MachineRestartPolicy string
var (
	MachineRestartPolicyNo        MachineRestartPolicy = "no"
	MachineRestartPolicyOnFailure MachineRestartPolicy = "on-failure"
	MachineRestartPolicyAlways    MachineRestartPolicy = "always"
	MachineRestartPolicySpotPrice MachineRestartPolicy = "spot-price"
)

type MachineSecret

type MachineSecret struct {
	// EnvVar is required and is the name of the environment variable that will be set from the
	// secret. It must be a valid environment variable name.
	EnvVar string `json:"env_var"`

	// Name is optional and when provided is used to reference a secret name where the EnvVar is
	// different from what was set as the secret name.
	Name string `json:"name"`
}

@description A Secret needing to be set in the environment of the Machine. env_var is required and name can be used to reference a secret name where the environment variable is different from what was set originally using the API. NOTE: When secrets are provided on any process, it will override the secrets provided at the machine level.

type MachineService

type MachineService struct {
	Protocol     string `json:"protocol,omitempty" toml:"protocol,omitempty"`
	InternalPort int    `json:"internal_port,omitempty" toml:"internal_port,omitempty"`
	// Accepts a string (new format) or a boolean (old format). For backward compatibility with older clients, the API continues to use booleans for "off" and "stop" in responses.
	// * "off" or false - Do not autostop the Machine.
	// * "stop" or true - Automatically stop the Machine.
	// * "suspend" - Automatically suspend the Machine, falling back to a full stop if this is not possible.
	Autostop                 *MachineAutostop           `json:"autostop,omitempty" swaggertype:"string" enums:"off,stop,suspend"`
	Autostart                *bool                      `json:"autostart,omitempty"`
	MinMachinesRunning       *int                       `json:"min_machines_running,omitempty"`
	Ports                    []MachinePort              `json:"ports,omitempty" toml:"ports,omitempty"`
	Checks                   []MachineCheck             `json:"checks,omitempty" toml:"checks,omitempty"`
	Concurrency              *MachineServiceConcurrency `json:"concurrency,omitempty" toml:"concurrency"`
	ForceInstanceKey         *string                    `json:"force_instance_key" toml:"force_instance_key"`
	ForceInstanceDescription *string                    `json:"force_instance_description,omitempty" toml:"force_instance_description"`
}

type MachineServiceConcurrency

type MachineServiceConcurrency struct {
	Type      string `json:"type,omitempty" toml:"type,omitempty"`
	HardLimit int    `json:"hard_limit,omitempty" toml:"hard_limit,omitempty"`
	SoftLimit int    `json:"soft_limit,omitempty" toml:"soft_limit,omitempty"`
}

type MachineStartResponse

type MachineStartResponse struct {
	Message       string `json:"message,omitempty"`
	Status        string `json:"status,omitempty"`
	PreviousState string `json:"previous_state,omitempty"`
}

type Organization

type Organization struct {
	ID                 string
	InternalNumericID  string
	Name               string
	RemoteBuilderImage string
	RemoteBuilderApp   *App
	Slug               string
	RawSlug            string
	Type               string
	PaidPlan           bool
	Billable           bool
	Settings           map[string]any

	Domains struct {
		Nodes *[]*Domain
		Edges *[]*struct {
			Cursor *string
			Node   *Domain
		}
	}

	WireGuardPeer *WireGuardPeer

	WireGuardPeers struct {
		Nodes *[]*WireGuardPeer
		Edges *[]*struct {
			Cursor *string
			Node   *WireGuardPeer
		}
	}

	DelegatedWireGuardTokens struct {
		Nodes *[]*DelegatedWireGuardTokenHandle
		Edges *[]*struct {
			Cursor *string
			Node   *DelegatedWireGuardTokenHandle
		}
	}

	LoggedCertificates *struct {
		Nodes []LoggedCertificate
	}

	LimitedAccessTokens *struct {
		Nodes []LimitedAccessToken
	}
}

func (*Organization) Basic added in v0.1.16

func (o *Organization) Basic() *OrganizationBasic

func (*Organization) GetID

func (o *Organization) GetID() string

func (*Organization) GetSlug

func (o *Organization) GetSlug() string

type OrganizationBasic

type OrganizationBasic struct {
	ID                string
	InternalNumericID string
	Name              string
	Slug              string
	RawSlug           string
	PaidPlan          bool
}

func (*OrganizationBasic) GetID

func (o *OrganizationBasic) GetID() string

func (*OrganizationBasic) GetSlug

func (o *OrganizationBasic) GetSlug() string

type OrganizationDetails

type OrganizationDetails struct {
	ID                 string
	InternalNumericID  string
	Name               string
	RemoteBuilderImage string
	RemoteBuilderApp   *App
	Slug               string
	Type               string
	ViewerRole         string
	Apps               struct {
		Nodes []App
	}
	Members struct {
		Edges []OrganizationMembershipEdge
	}
}

type OrganizationFilter

type OrganizationFilter func(*organizationFilter)
var AdminOnly OrganizationFilter = func(f *organizationFilter) { f.admin = true }

type OrganizationImpl

type OrganizationImpl interface {
	GetID() string
	GetSlug() string
}

type OrganizationMembershipEdge

type OrganizationMembershipEdge struct {
	Cursor   string
	Node     User
	Role     string
	JoinedAt time.Time
}

type OrganizationType

type OrganizationType string
const (
	OrganizationTypePersonal OrganizationType = "PERSONAL"
	OrganizationTypeShared   OrganizationType = "SHARED"
)

type PostDeploymentInfo added in v0.1.20

type PostDeploymentInfo struct {
	FlyctlVersion string `json:"flyctl_version"`
	Error         string `json:"error"`
}

type PostgresClusterAttachment

type PostgresClusterAttachment struct {
	ID                      string
	DatabaseName            string
	DatabaseUser            string
	EnvironmentVariableName string
}

type PostgresEnableConsulPayload

type PostgresEnableConsulPayload struct {
	ConsulURL string `json:"consulUrl"`
}

type ProcessStat

type ProcessStat struct {
	Pid           int32          `json:"pid"`
	Stime         uint64         `json:"stime"`
	Rtime         uint64         `json:"rtime"`
	Command       string         `json:"command"`
	Directory     string         `json:"directory"`
	Cpu           uint64         `json:"cpu"`
	Rss           uint64         `json:"rss"`
	ListenSockets []ListenSocket `json:"listen_sockets"`
}

type ProxyProtoOptions

type ProxyProtoOptions struct {
	Version string `json:"version,omitempty" toml:"version,omitempty"`
}

type Query

type Query struct {
	Errors Errors

	Apps struct {
		PageInfo struct {
			HasNextPage bool
			EndCursor   string
		}
		Nodes []App
	}
	App             App
	AppCompact      AppCompact
	AppBasic        AppBasic
	AppCertsCompact AppCertsCompact
	Viewer          User
	GqlMachine      GqlMachine
	Organizations   struct {
		Nodes []Organization
	}

	Organization        *Organization
	OrganizationDetails OrganizationDetails
	Volume              struct {
		App struct {
			Name string
		}
		State     string
		Snapshots struct {
			Nodes []VolumeSnapshotGql
		}
	}
	Domain *Domain

	Node  interface{}
	Nodes []interface{}

	Platform struct {
		RequestRegion string
		Regions       []Region
	}

	NearestRegion *Region

	LatestImageTag     string
	LatestImageDetails ImageVersion
	AppHostIssues      AppHostIssues

	// mutations
	CreateApp struct {
		App App
	}

	SetSecrets struct {
		Release Release
	}

	UnsetSecrets struct {
		Release Release
	}

	EnsureRemoteBuilder *struct {
		App     *App
		URL     string
		Release Release
	}

	EnsureMachineRemoteBuilder *struct {
		App     *App
		Machine *GqlMachine
	}

	CreateDoctorUrl SignedUrl

	AddCertificate struct {
		Certificate *AppCertificate
		Check       *HostnameCheck
	}

	DeleteCertificate DeleteCertificatePayload

	CheckCertificate struct {
		App         *App
		Certificate *AppCertificate
		Check       *HostnameCheck
	}

	AllocateIPAddress struct {
		App       App
		IPAddress IPAddress
	}
	AllocateEgressIPAddress struct {
		V4 string
		V6 string
	}
	ReleaseEgressIPAddress struct {
		V4 string
		V6 string
	}
	ReleaseIPAddress struct {
		App App
	}

	CreateDomain struct {
		Domain *Domain
	}
	CreateAndRegisterDomain struct {
		Domain *Domain
	}

	CheckDomain *CheckDomainResult

	ExportDnsZone struct {
		Contents string
	}

	ImportDnsZone struct {
		Warnings []ImportDnsWarning
		Changes  []ImportDnsChange
	}
	CreateOrganization CreateOrganizationPayload
	DeleteOrganization DeleteOrganizationPayload

	AddWireGuardPeer              CreatedWireGuardPeer
	EstablishSSHKey               SSHCertificate
	IssueCertificate              IssuedCertificate
	CreateDelegatedWireGuardToken DelegatedWireGuardToken
	DeleteDelegatedWireGuardToken DelegatedWireGuardToken

	RemoveWireGuardPeer struct {
		Organization Organization
	}

	AttachPostgresCluster *AttachPostgresClusterPayload
	EnablePostgresConsul  *PostgresEnableConsulPayload

	CreateOrganizationInvitation CreateOrganizationInvitation

	ValidateWireGuardPeers struct {
		InvalidPeerIPs []string
	}

	PostgresAttachments struct {
		Nodes []*PostgresClusterAttachment
	}

	DeleteOrganizationMembership *DeleteOrganizationMembershipPayload

	UpdateRemoteBuilder struct {
		Organization Organization
	}

	CanPerformBluegreenDeployment bool
	AppNameAvailable              bool

	LockApp *LockApp
}

Query - Master query which encapsulates all possible returned structures

type Region

type Region struct {
	Code             string
	Name             string
	Latitude         float32
	Longitude        float32
	GatewayAvailable bool
	RequiresPaidPlan bool
}

type Release

type Release struct {
	ID                 string
	Version            int
	Stable             bool
	InProgress         bool
	Reason             string
	Description        string
	Status             string
	DeploymentStrategy string
	Metadata           *ReleaseMetadata
	User               User
	EvaluationID       string
	CreatedAt          time.Time
	ImageRef           string
}

type ReleaseEgressIPAddressInput added in v0.1.31

type ReleaseEgressIPAddressInput struct {
	AppID     string `json:"appId"`
	MachineID string `json:"machineId"`
}

type ReleaseIPAddressInput

type ReleaseIPAddressInput struct {
	AppID       *string `json:"appId"`
	IPAddressID *string `json:"ipAddressId"`
	IP          *string `json:"ip"`
}

type ReleaseMetadata added in v0.1.20

type ReleaseMetadata struct {
	PostDeploymentInfo PostDeploymentInfo `json:"post_deployment_info,omitempty"`
}

type RemoveMachineInput

type RemoveMachineInput struct {
	ID   string `json:"id,omitempty"`
	Kill bool   `json:"kill,omitempty"`
}

type RestartMachineInput

type RestartMachineInput struct {
	ID               string        `json:"id,omitempty"`
	Signal           string        `json:"signal,omitempty"`
	Timeout          time.Duration `json:"timeout,omitempty"`
	ForceStop        bool          `json:"force_stop,omitempty"`
	SkipHealthChecks bool          `json:"skip_health_checks,omitempty"`
}

type SSHCertificate

type SSHCertificate struct {
	Certificate string
}

type Secret

type Secret struct {
	Name      string
	Digest    string
	CreatedAt time.Time
}

type SetSecretsInput

type SetSecretsInput struct {
	AppID   string                  `json:"appId"`
	Secrets []SetSecretsInputSecret `json:"secrets"`
}

type SetSecretsInputSecret

type SetSecretsInputSecret struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type SignedUrl

type SignedUrl struct {
	PutUrl string
}

type Static

type Static struct {
	GuestPath     string `toml:"guest_path" json:"guest_path" validate:"required"`
	UrlPrefix     string `toml:"url_prefix" json:"url_prefix" validate:"required"`
	TigrisBucket  string `toml:"tigris_bucket" json:"tigris_bucket"`
	IndexDocument string `toml:"index_document" json:"index_document"`
}

type StopConfig

type StopConfig struct {
	Timeout *Duration `json:"timeout,omitempty"`
	Signal  *string   `json:"signal,omitempty"`
}

type StopMachineInput

type StopMachineInput struct {
	ID      string   `json:"id,omitempty"`
	Signal  string   `json:"signal,omitempty"`
	Timeout Duration `json:"timeout,omitempty"`
}

type TLSOptions

type TLSOptions struct {
	ALPN              []string `json:"alpn,omitempty" toml:"alpn,omitempty"`
	Versions          []string `json:"versions,omitempty" toml:"versions,omitempty"`
	DefaultSelfSigned *bool    `json:"default_self_signed,omitempty" toml:"default_self_signed,omitempty"`
}

type Transport

type Transport struct {
	UnderlyingTransport http.RoundTripper
	UserAgent           string
	Token               string // deprecated
	Tokens              *tokens.Tokens
	EnableDebugTrace    bool
}

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

type UnlockAppInput added in v0.1.29

type UnlockAppInput struct {
	AppID  string `json:"app_id"`
	LockID string `json:"lock_id"`
}

type UnsetSecretsInput

type UnsetSecretsInput struct {
	AppID string   `json:"appId"`
	Keys  []string `json:"keys"`
}

type UpdateReleaseInput added in v0.1.13

type UpdateReleaseInput struct {
	// A unique identifier for the client performing the mutation.
	ClientMutationId string `json:"clientMutationId"`
	// The metadata for the release
	Metadata interface{} `json:"metadata"`
	// The ID of the release
	ReleaseId string `json:"releaseId"`
	// The new status for the release
	Status string `json:"status"`
}

Autogenerated input type of UpdateRelease

func (*UpdateReleaseInput) GetClientMutationId added in v0.1.13

func (v *UpdateReleaseInput) GetClientMutationId() string

GetClientMutationId returns UpdateReleaseInput.ClientMutationId, and is useful for accessing the field via an interface.

func (*UpdateReleaseInput) GetMetadata added in v0.1.19

func (v *UpdateReleaseInput) GetMetadata() interface{}

GetMetadata returns UpdateReleaseInput.Metadata, and is useful for accessing the field via an interface.

func (*UpdateReleaseInput) GetReleaseId added in v0.1.13

func (v *UpdateReleaseInput) GetReleaseId() string

GetReleaseId returns UpdateReleaseInput.ReleaseId, and is useful for accessing the field via an interface.

func (*UpdateReleaseInput) GetStatus added in v0.1.13

func (v *UpdateReleaseInput) GetStatus() string

GetStatus returns UpdateReleaseInput.Status, and is useful for accessing the field via an interface.

type UpdateReleaseResponse added in v0.1.13

type UpdateReleaseResponse struct {
	UpdateRelease UpdateReleaseUpdateReleaseUpdateReleasePayload `json:"updateRelease"`
}

UpdateReleaseResponse is returned by UpdateRelease on success.

func UpdateRelease added in v0.1.13

func UpdateRelease(
	ctx_ context.Context,
	client_ graphql.Client,
	input UpdateReleaseInput,
) (data_ *UpdateReleaseResponse, err_ error)

func (*UpdateReleaseResponse) GetUpdateRelease added in v0.1.13

GetUpdateRelease returns UpdateReleaseResponse.UpdateRelease, and is useful for accessing the field via an interface.

type UpdateReleaseUpdateReleaseUpdateReleasePayload added in v0.1.13

type UpdateReleaseUpdateReleaseUpdateReleasePayload struct {
	Release UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease `json:"release"`
}

UpdateReleaseUpdateReleaseUpdateReleasePayload includes the requested fields of the GraphQL type UpdateReleasePayload. The GraphQL type's documentation follows.

Autogenerated return type of UpdateRelease.

func (*UpdateReleaseUpdateReleaseUpdateReleasePayload) GetRelease added in v0.1.13

GetRelease returns UpdateReleaseUpdateReleaseUpdateReleasePayload.Release, and is useful for accessing the field via an interface.

type UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease added in v0.1.13

type UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease struct {
	// Unique ID
	Id string `json:"id"`
}

UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease includes the requested fields of the GraphQL type Release.

func (*UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease) GetId added in v0.1.13

GetId returns UpdateReleaseUpdateReleaseUpdateReleasePayloadRelease.Id, and is useful for accessing the field via an interface.

type UpdateVolumeRequest

type UpdateVolumeRequest struct {
	SnapshotRetention *int  `json:"snapshot_retention"`
	AutoBackupEnabled *bool `json:"auto_backup_enabled"`
}

type User

type User struct {
	ID              string
	Name            string
	Email           string
	EnablePaidHobby bool
}

type VMSize

type VMSize struct {
	Name        string
	CPUCores    float32
	CPUClass    string
	MemoryGB    float32
	MemoryMB    int
	PriceMonth  float32
	PriceSecond float32
}

type Volume

type Volume struct {
	ID                 string    `json:"id"`
	Name               string    `json:"name"`
	State              string    `json:"state"`
	SizeGb             int       `json:"size_gb"`
	Region             string    `json:"region"`
	Zone               string    `json:"zone"`
	Encrypted          bool      `json:"encrypted"`
	AttachedMachine    *string   `json:"attached_machine_id"`
	AttachedAllocation *string   `json:"attached_alloc_id"`
	CreatedAt          time.Time `json:"created_at"`
	HostDedicationID   string    `json:"host_dedication_id"`
	SnapshotRetention  int       `json:"snapshot_retention"`
	AutoBackupEnabled  bool      `json:"auto_backup_enabled"`
	HostStatus         string    `json:"host_status,omitempty"`
}

func (Volume) IsAttached

func (v Volume) IsAttached() bool

type VolumeSnapshot

type VolumeSnapshot struct {
	ID            string    `json:"id"`
	Size          int       `json:"size"`
	Digest        string    `json:"digest"`
	CreatedAt     time.Time `json:"created_at"`
	Status        string    `json:"status"`
	RetentionDays *int      `json:"retention_days"`
}

func NewVolumeSnapshotFrom added in v0.1.8

func NewVolumeSnapshotFrom(v VolumeSnapshotGql) VolumeSnapshot

type VolumeSnapshotGql added in v0.1.8

type VolumeSnapshotGql struct {
	ID            string    `json:"id"`
	Size          string    `json:"size"`
	Digest        string    `json:"digest"`
	CreatedAt     time.Time `json:"createdAt"`
	Status        string    `json:"status"`
	RetentionDays *int      `json:"retentionDays"`
}

type WireGuardPeer

type WireGuardPeer struct {
	ID            string
	Pubkey        string
	Region        string
	Name          string
	Peerip        string
	GatewayStatus *WireGuardPeerStatus
}

type WireGuardPeerStatus

type WireGuardPeerStatus struct {
	Endpoint       string
	LastHandshake  string
	SinceHandshake string
	Rx             int64
	Tx             int64
	Added          string
	SinceAdded     string
	Live           bool
	WgError        string
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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