context

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppCommandRunner

type AppCommandRunner interface {
	Run(ctx *Context, orgName, spaceName string) error
	SetAppName(name string)
}

type AppImportRunner

type AppImportRunner interface {
	Run(ctx *Context) error
	SetOrgName(name string)
	SetSpaceName(name string)
	SetAppName(name string)
}

type AutoScalerExporter

type AutoScalerExporter interface {
	ExportAutoScalerRules(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, exportDir string) error
	ExportAutoScalerInstances(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, exportDir string) error
	ExportAutoScalerSchedules(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, exportDir string) error
}

type CommandRunner

type CommandRunner interface {
	Run(ctx *Context) error
}

type Context

type Context struct {
	Debug              bool
	DirWriter          DirWriter
	ExportDir          string
	IncludedOrgs       []string
	ExcludedOrgs       []string
	DomainsToAdd       []string
	DomainsToReplace   map[string]string
	DropletCountToKeep int
	ConcurrencyLimit   int
	Metadata           *metadata.Metadata
	Summary            *report.Summary
	ExportCFClient     cf.Client
	ImportCFClient     cf.Client
	SpaceImporter      SpaceImporter
	SpaceExporter      SpaceExporter
	DropletExporter    DropletExporter
	ManifestExporter   ManifestExporter
	AutoScalerExporter AutoScalerExporter
	Logger             *log.Logger
	Progress           *mpb.Progress
	DisplayProgress    bool
}

func (*Context) InitLogger

func (ctx *Context) InitLogger()

type DirWriter

type DirWriter interface {
	Mkdir(dir string) error
	MkdirAll(dir string, perm os.FileMode) error
	IsEmpty(name string) (bool, error)
}

type DropletExporter

type DropletExporter interface {
	NumberOfPackages(ctx *Context, app cfclient.App) (float64, error)
	DownloadDroplet(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, exportDir string) error
	DownloadPackages(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, exportDir string) error
}

type ManifestExporter

type ManifestExporter interface {
	ExportAppManifest(ctx *Context, org cfclient.Org, space cfclient.Space, app cfclient.App, appExportDir string) error
}

type OrgCommandRunner

type OrgCommandRunner interface {
	Run(ctx *Context, org string) error
}

type ProcessFunc

type ProcessFunc func(*Context, QueryResult) ProcessResult

type ProcessResult

type ProcessResult struct {
	Value interface{}
	Err   error
}

type QueryResult

type QueryResult struct {
	Value interface{}
}

type QueryResultsCollector

type QueryResultsCollector interface {
	ResultCount() int
	ResultsPerPage() int
	GetResults() <-chan QueryResult
	AddResult(QueryResult)
	Close()
}

type QueryResultsProcessor

type QueryResultsProcessor interface {
	ExecuteQuery(ctx *Context, queryResultsCollector QueryResultsCollector, query func(collector QueryResultsCollector) (int, error), processor func(ctx *Context, value QueryResult) ProcessResult) (<-chan ProcessResult, error)
	ExecutePageQuery(ctx *Context, queryResultsCollector QueryResultsCollector, query func(page int, collector QueryResultsCollector) func() (int, error), processor ProcessFunc) (<-chan ProcessResult, error)
}

type SpaceCommandRunner

type SpaceCommandRunner interface {
	Run(ctx *Context, org, space string) error
}

type SpaceExporter

type SpaceExporter interface {
	ExportSpace(ctx *Context, space cfclient.Space, processor ProcessFunc) (<-chan ProcessResult, error)
}

type SpaceImporter

type SpaceImporter interface {
	ImportSpace(ctx *Context, processor ProcessFunc, files []string) (<-chan ProcessResult, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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