deploy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRegister

func MustRegister(provider string, deployerConstructor AssetDeployerConstructor)

MustRegister will mustRegister a deployer constructor corresponding to the provider to the list. The provider should be a globally unique human-readable identifier which will be used as Asset.Provider and the value of 'cloud-providers[i].provider' in profile. e.g. TencentCloud

All Deployer must call this function in init function to mustRegister itself.

Types

type AssetDeployerConstructor

type AssetDeployerConstructor = func(options map[string]interface{}) (Deployer, error)

type DeployError

type DeployError struct {
	Asset asset.Asseter
	Err   error
}

func NewDeployError

func NewDeployError(asset asset.Asseter, err error) *DeployError

func (*DeployError) Error

func (d *DeployError) Error() string

type Deployer

type Deployer interface {
	// Deploy the given pem cert to the all assets.
	//
	// Returns assets that were successfully deployed and errors. Please note that there is no
	// guarantee that len(deployedAsseters)+len(deployErrs)=len(assets), because some minor
	// problems do not count as errors, such as provider mismatch.
	Deploy(assets []asset.Asseter, cert []byte, key []byte) (deployedAsseters []asset.Asseter,
		deployErrs []*DeployError)
}

type UnionDeployer

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

UnionDeployer will not be registered to the list. Instead, it is responsible for instantiating registered deployers based on configuration and call each of them.

The main program usually wants to use this structure to perform the operation.

func NewUnionDeployer

func NewUnionDeployer(logger *zap.SugaredLogger, providersConfig []config.CloudProvider) *UnionDeployer

func (*UnionDeployer) Deploy

func (u *UnionDeployer) Deploy(assets []asset.Asseter, cert []byte,
	key []byte) (deployedAsseters []asset.Asseter, hasError bool)

Deploy calls each of registered deployer. All errors will be printed to logger with ERROR level.

Jump to

Keyboard shortcuts

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