fly_client

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppListItem

type AppListItem struct {
	Name string `json:"name"`
	Org  string `json:"org"`
}

type ExistsSecretCmd

type ExistsSecretCmd struct {
	AppName    string
	SecretName string
}

type FlyClient

type FlyClient interface {
	CreateOrgToken(
		ctx context.Context,
		orgSlug string,
	) (string, error)

	ExistsSecret(
		ctx context.Context,
		cmd ExistsSecretCmd,
	) (bool, error)

	StoreSecret(
		ctx context.Context,
		cmd StoreSecretCmd,
	) error

	ExistsApp(
		ctx context.Context,
		name string,
	) (bool, error)

	GetDeployedAppConfig(
		ctx context.Context,
		name string,
	) (model.AppConfig, error)

	GetAppVolumes(
		ctx context.Context,
		name string,
	) ([]model.VolumeState, error)

	CreateNewApp(
		ctx context.Context,
		cfg model.AppConfig,
		tempDir util_work_dir.WorkDir,
		twoStep bool,
	) error

	DeployExistingApp(
		ctx context.Context,
		cfg model.AppConfig,
		tempDir util_work_dir.WorkDir,
		deployCfg model.DeployConfig,
		region string,
	) error

	CreateVolume(
		ctx context.Context,
		app string,
		cfg model.VolumeConfig,
		region string,
	) (model.VolumeState, error)

	GetAppScale(
		ctx context.Context,
		app string,
	) ([]model.ScaleState, error)

	ExtendVolume(
		ctx context.Context,
		appName string,
		volumeId string,
		gb int,
	) error

	ScaleApp(
		ctx context.Context,
		app string,
		region string,
		count int,
	) error

	ScaleAppRam(
		ctx context.Context,
		app string,
		ramMb int,
	) error

	ScaleAppVm(
		ctx context.Context,
		app string,
		vm string,
	) error

	SaveSecrets(
		ctx context.Context,
		app string,
		secrets []Secret,
		stage bool,
	) error

	ListApps(
		ctx context.Context,
	) ([]AppListItem, error)

	ListIps(
		ctx context.Context,
		app string,
	) ([]IpListItem, error)

	DeleteIp(
		ctx context.Context,
		app string,
		id string,
		address string,
	) error

	CreateIp(
		ctx context.Context,
		app string,
		ip model.IpConfig,
	) error
}

func NewFlyClient

func NewFlyClient() FlyClient

type FlyClientImpl

type FlyClientImpl struct{}

func (FlyClientImpl) CreateIp added in v0.0.41

func (c FlyClientImpl) CreateIp(
	ctx context.Context,
	app string,
	ip model.IpConfig,
) error

func (FlyClientImpl) CreateNewApp

func (c FlyClientImpl) CreateNewApp(
	ctx context.Context,
	cfg model.AppConfig,
	tempDir util_work_dir.WorkDir,
	twoStep bool,
) error

func (FlyClientImpl) CreateOrgToken

func (c FlyClientImpl) CreateOrgToken(ctx context.Context, orgSlug string) (string, error)

func (FlyClientImpl) CreateVolume

func (c FlyClientImpl) CreateVolume(
	ctx context.Context,
	app string,
	cfg model.VolumeConfig,
	region string,
) (model.VolumeState, error)

func (FlyClientImpl) DeleteIp added in v0.0.41

func (c FlyClientImpl) DeleteIp(
	ctx context.Context,
	app string,
	id string,
	address string,
) error

func (FlyClientImpl) DeployExistingApp

func (c FlyClientImpl) DeployExistingApp(
	ctx context.Context,
	cfg model.AppConfig,
	tempDir util_work_dir.WorkDir,
	deployCfg model.DeployConfig,
	region string,
) error

func (FlyClientImpl) ExistsApp

func (c FlyClientImpl) ExistsApp(ctx context.Context, name string) (bool, error)

func (FlyClientImpl) ExistsSecret

func (c FlyClientImpl) ExistsSecret(ctx context.Context, cmd ExistsSecretCmd) (bool, error)

func (FlyClientImpl) ExtendVolume

func (c FlyClientImpl) ExtendVolume(
	ctx context.Context,
	appName string,
	volumeId string,
	gb int,
) error

func (FlyClientImpl) GetAppScale

func (c FlyClientImpl) GetAppScale(
	ctx context.Context,
	app string,
) ([]model.ScaleState, error)

func (FlyClientImpl) GetAppVolumes

func (c FlyClientImpl) GetAppVolumes(
	ctx context.Context,
	name string,
) ([]model.VolumeState, error)

func (FlyClientImpl) GetDeployedAppConfig

func (c FlyClientImpl) GetDeployedAppConfig(ctx context.Context, name string) (model.AppConfig, error)

func (FlyClientImpl) ListApps

func (c FlyClientImpl) ListApps(ctx context.Context) ([]AppListItem, error)

func (FlyClientImpl) ListIps added in v0.0.41

func (c FlyClientImpl) ListIps(ctx context.Context, app string) ([]IpListItem, error)

func (FlyClientImpl) SaveSecrets

func (c FlyClientImpl) SaveSecrets(
	ctx context.Context,
	app string,
	secrets []Secret,
	stage bool,
) error

func (FlyClientImpl) ScaleApp

func (c FlyClientImpl) ScaleApp(
	ctx context.Context,
	app string,
	region string,
	count int,
) error

func (FlyClientImpl) ScaleAppRam added in v0.0.45

func (c FlyClientImpl) ScaleAppRam(
	ctx context.Context,
	app string,
	ramMb int,
) error

func (FlyClientImpl) ScaleAppVm added in v0.0.45

func (c FlyClientImpl) ScaleAppVm(
	ctx context.Context,
	app string,
	vm string,
) error

func (FlyClientImpl) StoreSecret

func (c FlyClientImpl) StoreSecret(ctx context.Context, cmd StoreSecretCmd) error

type IpListItem added in v0.0.41

type IpListItem struct {
	Id        string    `json:"ID"`
	Address   string    `json:"Address"`
	Type      string    `json:"Type"`
	Region    string    `json:"Region"`
	Network   string    `json:"Network"`
	CreatedAt time.Time `json:"CreatedAt"`
}

func (IpListItem) Ipv added in v0.0.41

func (i IpListItem) Ipv() model.Ipv

func (IpListItem) IsPrivate added in v0.0.41

func (i IpListItem) IsPrivate() bool

type Secret

type Secret struct {
	Name  string
	Value string
}

type StoreSecretCmd

type StoreSecretCmd struct {
	AppName     string
	SecretName  string
	SecretValue string
}

Jump to

Keyboard shortcuts

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