inmem

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUser = fly.User{
	ID:              "USER1",
	Name:            "TestUser",
	Email:           "test@fly.dev",
	EnablePaidHobby: false,
}

Functions

This section is empty.

Types

type Build

type Build struct {
	ID              string
	AppName         string
	Status          string
	CreatedAt       time.Time
	WallClockTimeMs int64
}

type Client

type Client struct {
	CurrentUser *fly.User
	// contains filtered or unexported fields
}

func NewClient

func NewClient(s *Server) *Client

func (*Client) AddCertificate

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

func (*Client) AllocateIPAddress

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

func (*Client) AllocateSharedIPAddress

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

func (*Client) AppNameAvailable

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

func (*Client) AttachPostgresCluster

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

func (*Client) Authenticated

func (m *Client) Authenticated() bool

func (*Client) CanPerformBluegreenDeployment

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

func (*Client) CheckAppCertificate

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

func (*Client) CheckDomain

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

func (*Client) ClosestWireguardGatewayRegion

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

func (*Client) CreateAndRegisterDomain

func (m *Client) CreateAndRegisterDomain(organizationID string, name string) (*fly.Domain, error)

func (*Client) CreateApp

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

func (*Client) CreateBuild

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

func (*Client) CreateDelegatedWireGuardToken

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

func (*Client) CreateDoctorUrl

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

func (*Client) CreateDomain

func (m *Client) CreateDomain(organizationID string, name string) (*fly.Domain, error)

func (*Client) CreateOrganization

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

func (*Client) CreateOrganizationInvite

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

func (*Client) CreateRelease

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

func (*Client) CreateWireGuardPeer

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

func (*Client) DeleteApp

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

func (*Client) DeleteCertificate

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

func (*Client) DeleteDelegatedWireGuardToken

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

func (*Client) DeleteOrganization

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

func (*Client) DeleteOrganizationMembership

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

func (*Client) DetachPostgresCluster

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

func (*Client) EnablePostgresConsul

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

func (*Client) EnsureRemoteBuilder

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

func (*Client) ExportDNSRecords

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

func (*Client) FinishBuild

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

func (*Client) GenqClient

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

func (*Client) GetApp

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

func (*Client) GetAppBasic

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

func (*Client) GetAppCertificates

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

func (*Client) GetAppCompact

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

func (*Client) GetAppCurrentReleaseMachines

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

func (*Client) GetAppHostIssues

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

func (*Client) GetAppLimitedAccessTokens

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

func (*Client) GetAppLogs

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

func (*Client) GetAppNameFromVolume

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

func (*Client) GetAppNameStateFromVolume

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

func (*Client) GetAppNetwork

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

func (*Client) GetAppReleasesMachines

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

func (*Client) GetAppRemoteBuilder

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

func (*Client) GetAppSecrets

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

func (*Client) GetApps

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

func (*Client) GetAppsForOrganization

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

func (*Client) GetCurrentUser

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

func (*Client) GetDNSRecords

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

func (*Client) GetDelegatedWireGuardTokens

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

func (*Client) GetDetailedOrganizationBySlug

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

func (*Client) GetDomain

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

func (*Client) GetDomains

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

func (*Client) GetIPAddresses

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

func (*Client) GetLatestImageDetails

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

func (*Client) GetLatestImageTag

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

func (*Client) GetLoggedCertificates

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

func (*Client) GetMachine

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

func (*Client) GetNearestRegion

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

func (*Client) GetOrganizationByApp

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

func (*Client) GetOrganizationBySlug

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

func (*Client) GetOrganizationRemoteBuilderBySlug

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

func (*Client) GetOrganizations

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

func (*Client) GetSnapshotsFromVolume

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

func (*Client) GetWireGuardPeer

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

func (*Client) GetWireGuardPeers

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

func (*Client) ImportDNSRecords

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

func (*Client) IssueSSHCertificate

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

func (*Client) LatestImage

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

func (*Client) ListPostgresClusterAttachments

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

func (*Client) Logger

func (m *Client) Logger() fly.Logger

func (*Client) MoveApp

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

func (*Client) NewRequest

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

func (*Client) PlatformRegions

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

func (*Client) ReleaseIPAddress

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

func (*Client) RemoveWireGuardPeer

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

func (*Client) ResolveImageForApp

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

func (*Client) RevokeLimitedAccessToken

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

func (*Client) Run

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

func (*Client) RunWithContext

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

func (*Client) SetGenqClient

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

func (*Client) SetSecrets

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

func (*Client) UnsetSecrets

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

func (*Client) UpdateRelease

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

func (*Client) ValidateWireGuardPeers

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

type FlapsClient

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

func NewFlapsClient

func NewFlapsClient(server *Server, appName string) *FlapsClient

func (*FlapsClient) AcquireLease

func (m *FlapsClient) AcquireLease(ctx context.Context, machineID string, ttl *int) (*fly.MachineLease, error)

func (*FlapsClient) Cordon

func (m *FlapsClient) Cordon(ctx context.Context, machineID string, nonce string) (err error)

func (*FlapsClient) CreateApp

func (m *FlapsClient) CreateApp(ctx context.Context, name string, org string) (err error)

func (*FlapsClient) CreateVolume

func (m *FlapsClient) CreateVolume(ctx context.Context, req fly.CreateVolumeRequest) (*fly.Volume, error)

func (*FlapsClient) CreateVolumeSnapshot

func (m *FlapsClient) CreateVolumeSnapshot(ctx context.Context, volumeId string) error

func (*FlapsClient) DeleteMetadata

func (m *FlapsClient) DeleteMetadata(ctx context.Context, machineID, key string) error

func (*FlapsClient) DeleteVolume

func (m *FlapsClient) DeleteVolume(ctx context.Context, volumeId string) (*fly.Volume, error)

func (*FlapsClient) Destroy

func (m *FlapsClient) Destroy(ctx context.Context, input fly.RemoveMachineInput, nonce string) (err error)

func (*FlapsClient) Exec

func (*FlapsClient) ExtendVolume

func (m *FlapsClient) ExtendVolume(ctx context.Context, volumeId string, size_gb int) (*fly.Volume, bool, error)

func (*FlapsClient) FindLease

func (m *FlapsClient) FindLease(ctx context.Context, machineID string) (*fly.MachineLease, error)

func (*FlapsClient) Get

func (m *FlapsClient) Get(ctx context.Context, machineID string) (*fly.Machine, error)

func (*FlapsClient) GetAllVolumes

func (m *FlapsClient) GetAllVolumes(ctx context.Context) ([]fly.Volume, error)

func (*FlapsClient) GetMany

func (m *FlapsClient) GetMany(ctx context.Context, machineIDs []string) ([]*fly.Machine, error)

func (*FlapsClient) GetMetadata

func (m *FlapsClient) GetMetadata(ctx context.Context, machineID string) (map[string]string, error)

func (*FlapsClient) GetProcesses

func (m *FlapsClient) GetProcesses(ctx context.Context, machineID string) (fly.MachinePsResponse, error)

func (*FlapsClient) GetVolume

func (m *FlapsClient) GetVolume(ctx context.Context, volumeId string) (*fly.Volume, error)

func (*FlapsClient) GetVolumeSnapshots

func (m *FlapsClient) GetVolumeSnapshots(ctx context.Context, volumeId string) ([]fly.VolumeSnapshot, error)

func (*FlapsClient) GetVolumes

func (m *FlapsClient) GetVolumes(ctx context.Context) ([]fly.Volume, error)

func (*FlapsClient) Kill

func (m *FlapsClient) Kill(ctx context.Context, machineID string) (err error)

func (*FlapsClient) Launch

func (m *FlapsClient) Launch(ctx context.Context, builder fly.LaunchMachineInput) (out *fly.Machine, err error)

func (*FlapsClient) List

func (m *FlapsClient) List(ctx context.Context, state string) ([]*fly.Machine, error)

func (*FlapsClient) ListActive

func (m *FlapsClient) ListActive(ctx context.Context) ([]*fly.Machine, error)

func (*FlapsClient) ListFlyAppsMachines

func (m *FlapsClient) ListFlyAppsMachines(ctx context.Context) (machines []*fly.Machine, releaseCmdMachine *fly.Machine, err error)

func (*FlapsClient) NewRequest

func (m *FlapsClient) NewRequest(ctx context.Context, method, path string, in interface{}, headers map[string][]string) (*http.Request, error)

func (*FlapsClient) RefreshLease

func (m *FlapsClient) RefreshLease(ctx context.Context, machineID string, ttl *int, nonce string) (*fly.MachineLease, error)

func (*FlapsClient) ReleaseLease

func (m *FlapsClient) ReleaseLease(ctx context.Context, machineID, nonce string) error

func (*FlapsClient) Restart

func (m *FlapsClient) Restart(ctx context.Context, in fly.RestartMachineInput, nonce string) (err error)

func (*FlapsClient) SetMetadata

func (m *FlapsClient) SetMetadata(ctx context.Context, machineID, key, value string) error

func (*FlapsClient) Start

func (m *FlapsClient) Start(ctx context.Context, machineID string, nonce string) (out *fly.MachineStartResponse, err error)

func (*FlapsClient) Stop

func (m *FlapsClient) Stop(ctx context.Context, in fly.StopMachineInput, nonce string) (err error)

func (*FlapsClient) Suspend added in v0.2.71

func (m *FlapsClient) Suspend(ctx context.Context, machineID, nonce string) (err error)

func (*FlapsClient) Uncordon

func (m *FlapsClient) Uncordon(ctx context.Context, machineID string, nonce string) (err error)

func (*FlapsClient) Update

func (m *FlapsClient) Update(ctx context.Context, builder fly.LaunchMachineInput, nonce string) (out *fly.Machine, err error)

func (*FlapsClient) UpdateVolume

func (m *FlapsClient) UpdateVolume(ctx context.Context, volumeId string, req fly.UpdateVolumeRequest) (*fly.Volume, error)

func (*FlapsClient) Wait

func (m *FlapsClient) Wait(ctx context.Context, machine *fly.Machine, state string, timeout time.Duration) (err error)

func (*FlapsClient) WaitForApp

func (m *FlapsClient) WaitForApp(ctx context.Context, name string) error

type Release

type Release struct {
	ID               string
	AppID            string
	ClientMutationID string
	Definition       any
	Image            string
	PlatformVersion  string
	Status           string
	Strategy         string
	Version          int
}

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Client

func (s *Server) Client() *Client

func (*Server) CreateApp

func (s *Server) CreateApp(app *fly.App)

func (*Server) CreateBuild

func (s *Server) CreateBuild(ctx context.Context, appName string) (*Build, error)

func (*Server) CreateImage

func (s *Server) CreateImage(ctx context.Context, appName, imageRef string, image *fly.Image) error

func (*Server) CreateRelease

func (s *Server) CreateRelease(ctx context.Context, appID, clientMutationID, image, platformVersion, strategy string) (*Release, error)

func (*Server) FinishBuild

func (s *Server) FinishBuild(ctx context.Context, id, status string) (*Build, error)

func (*Server) FlapsClient

func (s *Server) FlapsClient(appName string) *FlapsClient

func (*Server) GetMachine

func (s *Server) GetMachine(ctx context.Context, appName, machineID string) (*fly.Machine, error)

func (*Server) Launch

func (s *Server) Launch(ctx context.Context, appName, name, region string, config *fly.MachineConfig) (*fly.Machine, error)

func (*Server) UpdateRelease

func (s *Server) UpdateRelease(ctx context.Context, id, clientMutationID, status string) error

Jump to

Keyboard shortcuts

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