api

package module
v0.0.0-...-677001b Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 26 Imported by: 7

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"
	MachineFlyPlatformVersion2                 = "v2"
	MachineProcessGroupApp                     = "app"
	MachineProcessGroupFlyAppReleaseCommand    = "fly_app_release_command"
	MachineProcessGroupFlyAppConsole           = "fly_app_console"
	MachineStateDestroyed                      = "destroyed"
	MachineStateDestroying                     = "destroying"
	MachineStateStarted                        = "started"
	MachineStateStopped                        = "stopped"
	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
)

Variables

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},
}

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 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 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
	Name      string
	State     string
	Status    string
	Deployed  bool
	Hostname  string
	AppURL    string
	Version   int
	NetworkID int

	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
	}
}

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
	}
	ImageDetails ImageVersion
}

func (*AppCompact) IsPostgresApp

func (app *AppCompact) IsPostgresApp() bool

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 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 {
	GenqClient genq.Client
	// 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) 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) 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) 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) CreateWireGuardPeer

func (c *Client) CreateWireGuardPeer(ctx context.Context, org *Organization, region, name, pubkey 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) EnsureRemoteBuilder

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

func (*Client) ExportDNSRecords

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

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) GetAppLimitedAccessTokens

func (c *Client) GetAppLimitedAccessTokens(ctx context.Context, appName string) ([]LimitedAccessToken, 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) GetAppReleasesMachines

func (c *Client) GetAppReleasesMachines(ctx context.Context, appName, status string, limit int) ([]Release, 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) 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) 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) GetOrganizationBySlug

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

func (*Client) GetOrganizations

func (client *Client) GetOrganizations(ctx context.Context, filters ...OrganizationFilter) ([]Organization, 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) ListPostgresClusterAttachments

func (client *Client) ListPostgresClusterAttachments(ctx context.Context, appName, postgresAppName string) ([]*PostgresClusterAttachment, 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) 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) SetSecrets

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

func (*Client) UnsetSecrets

func (c *Client) UnsetSecrets(ctx context.Context, appName string, keys []string) (*Release, 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 CreateOrganizationInvitation

type CreateOrganizationInvitation struct {
	Invitation Invitation
}

type CreateOrganizationPayload

type CreateOrganizationPayload struct {
	Organization Organization
}

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"`
	MachinesOnly      *bool  `json:"machines_only"`
	SnapshotRetention *int   `json:"snapshot_retention"`

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

	ComputeRequirements *MachineGuest `json:"compute"`
}

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"`
}

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 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 EnsureRemoteBuilderInput

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

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"`
}

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

type GqlMachine

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

	App *AppCompact

	IPs struct {
		Nodes []*MachineIP
	}
}

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"`
}

type HTTPResponseOptions

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

type HealthCheckStatus

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

func (*HealthCheckStatus) AllPassing

func (hcs *HealthCheckStatus) AllPassing() bool

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
}

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 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
	ExpiresAt time.Time
}

type ListenSocket

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

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"`
}

func (*Machine) AllHealthChecks

func (m *Machine) AllHealthChecks() *HealthCheckStatus

func (*Machine) FullImageRef

func (m *Machine) FullImageRef() string

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) 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 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"`
	// 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 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"`
}

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"`
}

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.
	Policy MachineRestartPolicy `json:"policy,omitempty" enums:"no,always,on-failure"`
	// 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"`
}

@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"
)

type MachineService

type MachineService struct {
	Protocol                 string                     `json:"protocol,omitempty" toml:"protocol,omitempty"`
	InternalPort             int                        `json:"internal_port,omitempty" toml:"internal_port,omitempty"`
	Autostop                 *bool                      `json:"autostop,omitempty"`
	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) GetID

func (o *Organization) GetID() string

func (*Organization) GetSlug

func (o *Organization) GetSlug() string

type OrganizationBasic

type OrganizationBasic struct {
	ID       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 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
		}
	}
	Domain *Domain

	Node  interface{}
	Nodes []interface{}

	Platform struct {
		RequestRegion string
		Regions       []Region
	}

	NearestRegion *Region

	LatestImageTag     string
	LatestImageDetails ImageVersion

	// 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
	}
	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
}

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
	User               User
	EvaluationID       string
	CreatedAt          time.Time
	ImageRef           string
}

type ReleaseIPAddressInput

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

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"`
}

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 UnsetSecretsInput

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

type UpdateVolumeRequest

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

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"`
}

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"`
}

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

Jump to

Keyboard shortcuts

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