cc

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(org, space string, service Service, instance *cf.ServiceInstance) flow.StepFunc

func Import

func Import(org, space string, service Service, instance *cf.ServiceInstance, encryptionKey string) flow.StepFunc

func IsCCDBTypeMigrator

func IsCCDBTypeMigrator(configType string) bool

func NewExportSequence

func NewExportSequence(org, space string, service Service, instance *cf.ServiceInstance, executor exec.Executor, manager config.OpsManager, controller *DatabaseConfig) flow.Flow

func NewImportSequence

func NewImportSequence(org, space string, service Service, instance *cf.ServiceInstance, encryptionKey string, executor exec.Executor, manager config.OpsManager, controller *DatabaseConfig) flow.Flow

func SetCloudControllerDatabaseCredentials

func SetCloudControllerDatabaseCredentials(e exec.Executor, cfg *DatabaseConfig, om config.OpsManager) flow.StepFunc

Types

type ClientHolder

type ClientHolder interface {
	SourceCFClient() cf.Client
	CFClient(toSource bool) cf.Client
}

type CloudControllerRepositoryFactory

type CloudControllerRepositoryFactory interface {
	NewCCDB(bool) (db.Repository, error)
}

type CloudControllerServiceFactory

type CloudControllerServiceFactory interface {
	NewCloudControllerService(cfg *Config, isExport bool) (Service, error)
}

type Config

type Config struct {
	SourceCloudControllerDatabase DatabaseConfig `yaml:"source_ccdb"`
	TargetCloudControllerDatabase DatabaseConfig `yaml:"target_ccdb"`
}

func (Config) IsSet

func (c Config) IsSet() bool

func (Config) Validate

func (c Config) Validate(isSource bool) error

type DatabaseConfig

type DatabaseConfig struct {
	Host           string `yaml:"db_host"`
	Username       string `yaml:"db_username"`
	Password       string `yaml:"db_password"`
	EncryptionKey  string `yaml:"db_encryption_key"`
	SSHHost        string `yaml:"ssh_host"`
	SSHUsername    string `yaml:"ssh_username"`
	SSHPassword    string `yaml:"ssh_password"`
	SSHPrivateKey  string `yaml:"ssh_private_key"`
	TunnelRequired bool   `yaml:"ssh_tunnel"`
}

func (DatabaseConfig) IsSet

func (c DatabaseConfig) IsSet() bool

func (DatabaseConfig) Validate

func (c DatabaseConfig) Validate() error

type DatabaseFactory

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

func NewDatabaseFactory

func NewDatabaseFactory(cfg *Config) DatabaseFactory

func (DatabaseFactory) NewCCDB

func (f DatabaseFactory) NewCCDB(isExport bool) (db.Repository, error)

type DefaultCloudControllerService

type DefaultCloudControllerService struct {
	Client           cf.Client
	Database         db.Repository
	ManifestExporter ManifestExporter
}

func NewCloudControllerService

func NewCloudControllerService(db db.Repository, cf cf.Client, manifestExporter ManifestExporter) DefaultCloudControllerService

func (DefaultCloudControllerService) Create

func (m DefaultCloudControllerService) Create(org, space string, instance *cf.ServiceInstance, encryptionKey string) error

func (DefaultCloudControllerService) CreateApp

func (m DefaultCloudControllerService) CreateApp(org, space, name string) (string, error)

func (DefaultCloudControllerService) CreateServiceBinding

func (m DefaultCloudControllerService) CreateServiceBinding(binding *cf.ServiceBinding, appGUID string, encryptionKey string) error

func (DefaultCloudControllerService) CreateServiceKey

func (m DefaultCloudControllerService) CreateServiceKey(si cf.ServiceInstance, key cf.ServiceKey) error

func (DefaultCloudControllerService) Delete

func (m DefaultCloudControllerService) Delete(org, space string, instance *cf.ServiceInstance) error

func (DefaultCloudControllerService) DownloadManifest

func (m DefaultCloudControllerService) DownloadManifest(org, space, appName string) (cf.Application, error)

func (DefaultCloudControllerService) FindAppByGUID

func (m DefaultCloudControllerService) FindAppByGUID(guid string) (string, error)

func (DefaultCloudControllerService) ServiceInstanceExists

func (m DefaultCloudControllerService) ServiceInstanceExists(org, space, instanceName string) (bool, error)

type DefaultCloudControllerServiceFactory

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

func NewCloudControllerServiceFactory

func NewCloudControllerServiceFactory(h ClientHolder, manifestExporter ManifestExporter) DefaultCloudControllerServiceFactory

func (DefaultCloudControllerServiceFactory) NewCloudControllerService

func (f DefaultCloudControllerServiceFactory) NewCloudControllerService(cfg *Config, isExport bool) (Service, error)

type DefaultManifestExporter

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

func NewManifestExporter

func NewManifestExporter(cfg *config.Config, h ClientHolder) *DefaultManifestExporter

func (*DefaultManifestExporter) ExportAppManifest

func (m *DefaultManifestExporter) ExportAppManifest(org cfclient.Org, space cfclient.Space, app cfclient.App) (cf.Application, error)

type ManifestExporter

type ManifestExporter interface {
	ExportAppManifest(org cfclient.Org, space cfclient.Space, app cfclient.App) (cf.Application, error)
}

type Migrator

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

func NewMigrator

func NewMigrator(flow flow.Flow) *Migrator

func (*Migrator) Migrate

func (m *Migrator) Migrate(ctx context.Context) (*cf.ServiceInstance, error)

func (*Migrator) Validate

func (m *Migrator) Validate(si *cf.ServiceInstance, export bool) error

type Service

type Service interface {
	Create(org, space string, instance *cf.ServiceInstance, encryptionKey string) error
	Delete(org, space string, instance *cf.ServiceInstance) error
	ServiceInstanceExists(org, space, name string) (bool, error)
	CreateServiceKey(si cf.ServiceInstance, key cf.ServiceKey) error
	CreateApp(org, space, name string) (string, error)
	CreateServiceBinding(binding *cf.ServiceBinding, appGUID string, encryptionKey string) error
	FindAppByGUID(guid string) (string, error)
	DownloadManifest(org, space, appName string) (cf.Application, error)
}

Directories

Path Synopsis
db
fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
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