Documentation ¶
Index ¶
- type Cmd
- type ExtensibleFakeProvisioner
- func (p *ExtensibleFakeProvisioner) GetPlatform(name string) *provisionedPlatform
- func (p *ExtensibleFakeProvisioner) PlatformAdd(opts provision.PlatformOptions) error
- func (p *ExtensibleFakeProvisioner) PlatformRemove(name string) error
- func (p *ExtensibleFakeProvisioner) PlatformUpdate(opts provision.PlatformOptions) error
- type FakeApp
- func (a *FakeApp) AddInstance(instanceApp bind.InstanceApp, w io.Writer) error
- func (a *FakeApp) AddUnit(u provision.Unit)
- func (a *FakeApp) BindUnit(unit *provision.Unit) error
- func (a *FakeApp) Envs() map[string]bind.EnvVar
- func (a *FakeApp) GetCommands() []string
- func (a *FakeApp) GetCpuShare() int
- func (a *FakeApp) GetDeploys() uint
- func (a *FakeApp) GetInstances(serviceName string) []bind.ServiceInstance
- func (a *FakeApp) GetIp() string
- func (a *FakeApp) GetMemory() int64
- func (a *FakeApp) GetName() string
- func (a *FakeApp) GetPlatform() string
- func (a *FakeApp) GetPool() string
- func (a *FakeApp) GetQuota() quota.Quota
- func (app *FakeApp) GetRouter() (string, error)
- func (a *FakeApp) GetSwap() int64
- func (app *FakeApp) GetTeamOwner() string
- func (app *FakeApp) GetTeamsName() []string
- func (a *FakeApp) GetUnits() ([]bind.Unit, error)
- func (app *FakeApp) GetUpdatePlatform() bool
- func (a *FakeApp) HasBind(unit *provision.Unit) bool
- func (a *FakeApp) HasLog(source, unit, message string) bool
- func (a *FakeApp) InstanceEnv(env string) map[string]bind.EnvVar
- func (a *FakeApp) Log(message, source, unit string) error
- func (a *FakeApp) Logs() []string
- func (a *FakeApp) RemoveInstance(instanceApp bind.InstanceApp, w io.Writer) error
- func (a *FakeApp) Run(cmd string, w io.Writer, once bool) error
- func (a *FakeApp) SerializeEnvVars() error
- func (a *FakeApp) SetEnv(env bind.EnvVar)
- func (a *FakeApp) SetEnvs(setEnvs bind.SetEnvApp, w io.Writer) error
- func (a *FakeApp) SetQuotaInUse(inUse int) error
- func (a *FakeApp) UnbindUnit(unit *provision.Unit) error
- func (a *FakeApp) Units() ([]provision.Unit, error)
- func (a *FakeApp) UnsetEnvs(unsetEnvs bind.UnsetEnvApp, w io.Writer) error
- type FakeConn
- func (c *FakeConn) Close() error
- func (c *FakeConn) LocalAddr() net.Addr
- func (c *FakeConn) Read(b []byte) (int, error)
- func (c *FakeConn) RemoteAddr() net.Addr
- func (c *FakeConn) SetDeadline(t time.Time) error
- func (c *FakeConn) SetReadDeadline(t time.Time) error
- func (c *FakeConn) SetWriteDeadline(t time.Time) error
- func (c *FakeConn) Write(b []byte) (int, error)
- type FakeProvisioner
- func (p *FakeProvisioner) AddUnit(app provision.App, unit provision.Unit)
- func (p *FakeProvisioner) AddUnits(app provision.App, n uint, process string, w io.Writer) ([]provision.Unit, error)
- func (p *FakeProvisioner) Addr(app provision.App) (string, error)
- func (p *FakeProvisioner) ArchiveDeploy(app provision.App, archiveURL string, w io.Writer) (string, error)
- func (p *FakeProvisioner) CustomData(app provision.App) map[string]interface{}
- func (p *FakeProvisioner) Destroy(app provision.App) error
- func (p *FakeProvisioner) ExecuteCommand(stdout, stderr io.Writer, app provision.App, cmd string, args ...string) error
- func (p *FakeProvisioner) ExecuteCommandOnce(stdout, stderr io.Writer, app provision.App, cmd string, args ...string) error
- func (p *FakeProvisioner) GetCmds(cmd string, app provision.App) []Cmd
- func (p *FakeProvisioner) GetUnits(app provision.App) []provision.Unit
- func (p *FakeProvisioner) GitDeploy(app provision.App, version string, w io.Writer) (string, error)
- func (p *FakeProvisioner) HasCName(app provision.App, cname string) bool
- func (p *FakeProvisioner) ImageDeploy(app provision.App, img string, w io.Writer) (string, error)
- func (p *FakeProvisioner) MetricEnvs(app provision.App) map[string]string
- func (p *FakeProvisioner) PrepareFailure(method string, err error)
- func (p *FakeProvisioner) PrepareOutput(b []byte)
- func (p *FakeProvisioner) Provision(app provision.App) error
- func (p *FakeProvisioner) Provisioned(app provision.App) bool
- func (p *FakeProvisioner) RegisterUnit(unit provision.Unit, customData map[string]interface{}) error
- func (p *FakeProvisioner) RemoveUnits(app provision.App, n uint, process string, w io.Writer) error
- func (p *FakeProvisioner) Reset()
- func (p *FakeProvisioner) Restart(app provision.App, process string, w io.Writer) error
- func (p *FakeProvisioner) Restarts(app provision.App, process string) int
- func (p *FakeProvisioner) RoutableUnits(app provision.App) ([]provision.Unit, error)
- func (p *FakeProvisioner) SetCName(app provision.App, cname string) error
- func (p *FakeProvisioner) SetUnitStatus(unit provision.Unit, status provision.Status) error
- func (p *FakeProvisioner) Shell(opts provision.ShellOptions) error
- func (p *FakeProvisioner) Shells(unit string) []provision.ShellOptions
- func (p *FakeProvisioner) Start(app provision.App, process string) error
- func (p *FakeProvisioner) Starts(app provision.App, process string) int
- func (p *FakeProvisioner) Stop(app provision.App, process string) error
- func (p *FakeProvisioner) Stops(app provision.App, process string) int
- func (p *FakeProvisioner) Swap(app1, app2 provision.App) error
- func (p *FakeProvisioner) Units(app provision.App) ([]provision.Unit, error)
- func (p *FakeProvisioner) UnsetCName(app provision.App, cname string) error
- func (p *FakeProvisioner) UploadDeploy(app provision.App, file io.ReadCloser, w io.Writer) (string, error)
- func (p *FakeProvisioner) ValidAppImages(appName string) ([]string, error)
- func (p *FakeProvisioner) Version(app provision.App) string
- type Hijacker
- type PipelineErrorFakeProvisioner
- type PipelineFakeProvisioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtensibleFakeProvisioner ¶
type ExtensibleFakeProvisioner struct { *FakeProvisioner // contains filtered or unexported fields }
func (*ExtensibleFakeProvisioner) GetPlatform ¶
func (p *ExtensibleFakeProvisioner) GetPlatform(name string) *provisionedPlatform
func (*ExtensibleFakeProvisioner) PlatformAdd ¶
func (p *ExtensibleFakeProvisioner) PlatformAdd(opts provision.PlatformOptions) error
func (*ExtensibleFakeProvisioner) PlatformRemove ¶
func (p *ExtensibleFakeProvisioner) PlatformRemove(name string) error
func (*ExtensibleFakeProvisioner) PlatformUpdate ¶
func (p *ExtensibleFakeProvisioner) PlatformUpdate(opts provision.PlatformOptions) error
type FakeApp ¶
type FakeApp struct { Commands []string Memory int64 Swap int64 Deploys uint Pool string UpdatePlatform bool TeamOwner string Teams []string quota.Quota // contains filtered or unexported fields }
Fake implementation for provision.App.
func NewFakeApp ¶
func (*FakeApp) AddInstance ¶
func (*FakeApp) GetCommands ¶
func (*FakeApp) GetCpuShare ¶
func (*FakeApp) GetDeploys ¶
func (*FakeApp) GetInstances ¶
func (a *FakeApp) GetInstances(serviceName string) []bind.ServiceInstance
func (*FakeApp) GetPlatform ¶
func (*FakeApp) GetTeamOwner ¶
func (*FakeApp) GetTeamsName ¶
func (*FakeApp) GetUpdatePlatform ¶
func (*FakeApp) RemoveInstance ¶
func (*FakeApp) SerializeEnvVars ¶
func (*FakeApp) SetQuotaInUse ¶
type FakeConn ¶
func (*FakeConn) RemoteAddr ¶
type FakeProvisioner ¶
type FakeProvisioner struct {
// contains filtered or unexported fields
}
Fake implementation for provision.Provisioner.
func NewFakeProvisioner ¶
func NewFakeProvisioner() *FakeProvisioner
func (*FakeProvisioner) AddUnit ¶
func (p *FakeProvisioner) AddUnit(app provision.App, unit provision.Unit)
func (*FakeProvisioner) ArchiveDeploy ¶
func (*FakeProvisioner) CustomData ¶
func (p *FakeProvisioner) CustomData(app provision.App) map[string]interface{}
func (*FakeProvisioner) ExecuteCommand ¶
func (p *FakeProvisioner) ExecuteCommand(stdout, stderr io.Writer, app provision.App, cmd string, args ...string) error
ExecuteCommand will pretend to execute the given command, recording data about it.
The output of the command must be prepared with PrepareOutput, and failures must be prepared with PrepareFailure. In case of failure, the prepared output will be sent to the standard error stream, otherwise, it will be sent to the standard error stream.
When there is no output nor failure prepared, ExecuteCommand will return a timeout error.
func (*FakeProvisioner) ExecuteCommandOnce ¶
func (*FakeProvisioner) GetCmds ¶
func (p *FakeProvisioner) GetCmds(cmd string, app provision.App) []Cmd
Returns the number of calls to restart. GetCmds returns a list of commands executed in an app. If you don't specify the command (an empty string), it will return all commands executed in the given app.
func (*FakeProvisioner) GetUnits ¶
func (p *FakeProvisioner) GetUnits(app provision.App) []provision.Unit
func (*FakeProvisioner) HasCName ¶
func (p *FakeProvisioner) HasCName(app provision.App, cname string) bool
func (*FakeProvisioner) ImageDeploy ¶
func (*FakeProvisioner) MetricEnvs ¶
func (p *FakeProvisioner) MetricEnvs(app provision.App) map[string]string
MetricEnvs returns the metric envs for the app
func (*FakeProvisioner) PrepareFailure ¶
func (p *FakeProvisioner) PrepareFailure(method string, err error)
PrepareFailure prepares a failure for the given method name.
For instance, PrepareFailure("GitDeploy", errors.New("GitDeploy failed")) will cause next Deploy call to return the given error. Multiple calls to this method will enqueue failures, i.e. three calls to PrepareFailure("GitDeploy"...) means that the three next GitDeploy call will fail.
func (*FakeProvisioner) PrepareOutput ¶
func (p *FakeProvisioner) PrepareOutput(b []byte)
PrepareOutput sends the given slice of bytes to a queue of outputs.
Each prepared output will be used in the ExecuteCommand. It might be sent to the standard output or standard error. See ExecuteCommand docs for more details.
func (*FakeProvisioner) Provisioned ¶
func (p *FakeProvisioner) Provisioned(app provision.App) bool
Provisioned checks whether the given app has been provisioned.
func (*FakeProvisioner) RegisterUnit ¶
func (p *FakeProvisioner) RegisterUnit(unit provision.Unit, customData map[string]interface{}) error
func (*FakeProvisioner) RemoveUnits ¶
func (*FakeProvisioner) Reset ¶
func (p *FakeProvisioner) Reset()
Reset cleans up the FakeProvisioner, deleting all apps and their data. It also deletes prepared failures and output. It's like calling NewFakeProvisioner again, without all the allocations.
func (*FakeProvisioner) Restarts ¶
func (p *FakeProvisioner) Restarts(app provision.App, process string) int
Restarts returns the number of restarts for a given app.
func (*FakeProvisioner) RoutableUnits ¶
func (*FakeProvisioner) SetCName ¶
func (p *FakeProvisioner) SetCName(app provision.App, cname string) error
func (*FakeProvisioner) SetUnitStatus ¶
func (*FakeProvisioner) Shell ¶
func (p *FakeProvisioner) Shell(opts provision.ShellOptions) error
func (*FakeProvisioner) Shells ¶
func (p *FakeProvisioner) Shells(unit string) []provision.ShellOptions
Shells return all shell calls to the given unit.
func (*FakeProvisioner) Start ¶
func (p *FakeProvisioner) Start(app provision.App, process string) error
func (*FakeProvisioner) Starts ¶
func (p *FakeProvisioner) Starts(app provision.App, process string) int
Starts returns the number of starts for a given app.
func (*FakeProvisioner) Stop ¶
func (p *FakeProvisioner) Stop(app provision.App, process string) error
func (*FakeProvisioner) Stops ¶
func (p *FakeProvisioner) Stops(app provision.App, process string) int
Stops returns the number of stops for a given app.
func (*FakeProvisioner) UnsetCName ¶
func (p *FakeProvisioner) UnsetCName(app provision.App, cname string) error
func (*FakeProvisioner) UploadDeploy ¶
func (p *FakeProvisioner) UploadDeploy(app provision.App, file io.ReadCloser, w io.Writer) (string, error)
func (*FakeProvisioner) ValidAppImages ¶
func (p *FakeProvisioner) ValidAppImages(appName string) ([]string, error)
type PipelineErrorFakeProvisioner ¶
type PipelineErrorFakeProvisioner struct {
*FakeProvisioner
}
func (*PipelineErrorFakeProvisioner) DeployPipeline ¶
func (p *PipelineErrorFakeProvisioner) DeployPipeline() *action.Pipeline
type PipelineFakeProvisioner ¶
type PipelineFakeProvisioner struct { *FakeProvisioner // contains filtered or unexported fields }
func (*PipelineFakeProvisioner) DeployPipeline ¶
func (p *PipelineFakeProvisioner) DeployPipeline() *action.Pipeline
func (*PipelineFakeProvisioner) ExecutedPipeline ¶
func (p *PipelineFakeProvisioner) ExecutedPipeline() bool