migrate

package
v0.0.0-...-6e3717d Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllSourcePlatforms = []SourcePlatform{
	SourcePlatformHeroku,
}

Functions

func InteractiveSetup

func InteractiveSetup(ctx context.Context, fabric client.FabricClient, surveyor surveyor.Surveyor, heroku HerokuClientInterface, sourcePlatform SourcePlatform) (string, error)

Types

type APIResponse

type APIResponse struct {
	Data  interface{} `json:"data,omitempty"`
	Error string      `json:"error,omitempty"`
}

APIResponse represents a generic API response

type HerokuAddon

type HerokuAddon struct {
	Name         string `json:"name"`
	ID           string `json:"id"`
	AddonService struct {
		HumanName string `json:"human_name"`
		ID        string `json:"id"`
		Name      string `json:"name"`
	} `json:"addon_service"`
	Plan struct {
		HumanName string `json:"human_name"`
		ID        string `json:"id"`
		Name      string `json:"name"`
	} `json:"plan"`
	Attachments []struct {
		Name  string `json:"name"`
		Addon struct {
			ID   string `json:"id"`
			Name string `json:"name"`
			App  struct {
				Name string `json:"name"`
				ID   string `json:"id"`
			} `json:"app"`
		} `json:"addon"`
	} `json:"attachments"`
	State string `json:"state"`
}

type HerokuApplication

type HerokuApplication struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type HerokuApplicationInfo

type HerokuApplicationInfo struct {
	Addons       []HerokuAddon             `json:"addons"`
	Dynos        []HerokuDyno              `json:"dynos"`
	ConfigVars   HerokuConfigVars          `json:"config_vars"`
	PGInfo       []PGInfo                  `json:"pg_info"`
	DynoSizes    map[string]HerokuDynoSize `json:"dyno_sizes"`
	ReleaseTasks []HerokuReleaseTask       `json:"release_tasks"`
}

type HerokuClient

type HerokuClient struct {
	Token      string
	HTTPClient *http.Client
	BaseURL    string
}

HerokuClient represents the Heroku API client

func NewHerokuClient

func NewHerokuClient() *HerokuClient

NewHerokuClient creates a new Heroku API client

func (*HerokuClient) GetDynoSize

func (h *HerokuClient) GetDynoSize(ctx context.Context, dynoSizeName string) (HerokuDynoSize, error)

func (*HerokuClient) GetFormation

func (h *HerokuClient) GetFormation(ctx context.Context, appName string) ([]HerokuFormation, error)

func (*HerokuClient) GetPGInfo

func (h *HerokuClient) GetPGInfo(ctx context.Context, addonID string) (PGInfo, error)

func (*HerokuClient) GetReleaseTasks

func (h *HerokuClient) GetReleaseTasks(ctx context.Context, appName string) ([]HerokuReleaseTask, error)

func (*HerokuClient) ListAddons

func (h *HerokuClient) ListAddons(ctx context.Context, appName string) ([]HerokuAddon, error)

func (*HerokuClient) ListApps

func (h *HerokuClient) ListApps(ctx context.Context) ([]HerokuApplication, error)

func (*HerokuClient) ListConfigVars

func (h *HerokuClient) ListConfigVars(ctx context.Context, appName string) (HerokuConfigVars, error)

func (*HerokuClient) ListDynos

func (h *HerokuClient) ListDynos(ctx context.Context, appName string) ([]HerokuDyno, error)

func (*HerokuClient) SetToken

func (h *HerokuClient) SetToken(token string)

type HerokuClientInterface

type HerokuClientInterface interface {
	SetToken(token string)
	ListApps(ctx context.Context) ([]HerokuApplication, error)
	ListDynos(ctx context.Context, appName string) ([]HerokuDyno, error)
	ListAddons(ctx context.Context, appName string) ([]HerokuAddon, error)
	GetDynoSize(ctx context.Context, dynoSizeName string) (HerokuDynoSize, error)
	GetPGInfo(ctx context.Context, addonID string) (PGInfo, error)
	ListConfigVars(ctx context.Context, appName string) (HerokuConfigVars, error)
	GetReleaseTasks(ctx context.Context, appName string) ([]HerokuReleaseTask, error)
}

HerokuClientInterface defines the interface for Heroku client operations

type HerokuConfigVars

type HerokuConfigVars map[string]string

type HerokuDyno

type HerokuDyno struct {
	Name         string `json:"name"`
	Command      string `json:"command"`
	Size         string `json:"size"`
	DynoSizeUuid string `json:"dyno_size_uuid"`
	Type         string `json:"type"`
}

type HerokuDynoSize

type HerokuDynoSize struct {
	Architecture     string  `json:"architecture"`
	Compute          int     `json:"compute"`
	PreciseDynoUnits float64 `json:"precise_dyno_units"`
	Memory           float64 `json:"memory"`
	Name             string  `json:"name"`
}

type HerokuFormation

type HerokuFormation struct {
	Command string `json:"command"`
	Type    string `json:"type"`
	Size    string `json:"size"`
}

type HerokuReleaseTask

type HerokuReleaseTask = HerokuFormation

type PGInfo

type PGInfo struct {
	DatabaseName string `json:"database_name"`
	NumBytes     int64  `json:"num_bytes"`
	Info         []struct {
		Name   string   `json:"name"`
		Values []string `json:"values"`
	} `json:"info"`
}

type SourcePlatform

type SourcePlatform string
const (
	SourcePlatformUnspecified SourcePlatform = ""
	SourcePlatformHeroku      SourcePlatform = "heroku"
)

func ParseSourcePlatform

func ParseSourcePlatform(input string) (SourcePlatform, error)

func (*SourcePlatform) Set

func (sp *SourcePlatform) Set(val string) error

Set implements the pflag.Value interface.

func (*SourcePlatform) String

func (sp *SourcePlatform) String() string

String implements the pflag.Value interface.

func (*SourcePlatform) Type

func (sp *SourcePlatform) Type() string

Type implements the pflag.Value interface (optional, but recommended).

Jump to

Keyboard shortcuts

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