Documentation ¶
Index ¶
- type Cmd
- type FakeApp
- func (a *FakeApp) AddInstance(instanceArgs bind.AddInstanceArgs) 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 (app *FakeApp) GetAddresses() ([]string, error)
- func (a *FakeApp) GetCname() []string
- func (a *FakeApp) GetCommands() []string
- func (a *FakeApp) GetCpuShare() int
- func (a *FakeApp) GetDeploys() uint
- func (a *FakeApp) GetLock() provision.AppLock
- func (a *FakeApp) GetMemory() int64
- func (a *FakeApp) GetName() string
- func (a *FakeApp) GetPlatform() string
- func (a *FakeApp) GetPlatformVersion() string
- func (a *FakeApp) GetPool() string
- func (a *FakeApp) GetQuota() quota.Quota
- func (app *FakeApp) GetRouters() []appTypes.AppRouter
- func (a *FakeApp) GetServiceEnvs() []bind.ServiceEnvVar
- func (a *FakeApp) GetSwap() int64
- func (a *FakeApp) GetTeamOwner() string
- func (a *FakeApp) GetTeamsName() []string
- func (a *FakeApp) GetUUID() (string, error)
- func (a *FakeApp) GetUnits() ([]bind.Unit, error)
- func (a *FakeApp) GetUpdatePlatform() bool
- func (a *FakeApp) HasBind(unit *provision.Unit) bool
- func (a *FakeApp) HasLog(source, unit, message string) bool
- func (a *FakeApp) Log(message, source, unit string) error
- func (a *FakeApp) Logs() []string
- func (a *FakeApp) RemoveInstance(instanceArgs bind.RemoveInstanceArgs) error
- func (a *FakeApp) Run(cmd string, w io.Writer, args provision.RunArgs) error
- func (a *FakeApp) SetEnv(env bind.EnvVar)
- func (a *FakeApp) SetEnvs(setEnvs bind.SetEnvArgs) 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.UnsetEnvArgs) 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 FakeNode
- func (n *FakeNode) Address() string
- func (n *FakeNode) FailureCount() int
- func (n *FakeNode) HasSuccess() bool
- func (n *FakeNode) IaaSID() string
- func (n *FakeNode) Metadata() map[string]string
- func (n *FakeNode) MetadataNoPrefix() map[string]string
- func (n *FakeNode) Pool() string
- func (n *FakeNode) Provisioner() provision.NodeProvisioner
- func (n *FakeNode) ResetFailures()
- func (n *FakeNode) SetHealth(failures int, hasSuccess bool)
- func (n *FakeNode) Status() string
- func (n *FakeNode) Units() ([]provision.Unit, error)
- type FakeProvisioner
- func (p *FakeProvisioner) AddNode(opts provision.AddNodeOptions) error
- func (p *FakeProvisioner) AddUnit(app provision.App, unit provision.Unit)
- func (p *FakeProvisioner) AddUnits(app provision.App, n uint, process string, w io.Writer) error
- func (p *FakeProvisioner) AddUnitsToNode(app provision.App, n uint, process string, w io.Writer, nodeAddr string) ([]provision.Unit, error)
- func (p *FakeProvisioner) Addr(app provision.App) (string, error)
- func (p *FakeProvisioner) AllExecs() map[string][]provision.ExecOptions
- func (p *FakeProvisioner) ArchiveDeploy(app provision.App, archiveURL string, evt *event.Event) (string, error)
- func (p *FakeProvisioner) CleanImage(appName, imgName string) error
- func (p *FakeProvisioner) CustomData(app provision.App) map[string]interface{}
- func (p *FakeProvisioner) DeleteVolume(volName, pool string) error
- func (p *FakeProvisioner) Deploy(app provision.App, img string, evt *event.Event) (string, error)
- func (p *FakeProvisioner) Destroy(app provision.App) error
- func (p *FakeProvisioner) Execs(unit string) []provision.ExecOptions
- func (p *FakeProvisioner) ExecuteCommand(opts provision.ExecOptions) error
- func (p *FakeProvisioner) FilterAppsByUnitStatus(apps []provision.App, status []string) ([]provision.App, error)
- func (p *FakeProvisioner) GetAppFromUnitID(unitID string) (provision.App, error)
- func (p *FakeProvisioner) GetClient(app provision.App) (provision.BuilderDockerClient, error)
- func (p *FakeProvisioner) GetName() string
- func (p *FakeProvisioner) GetNode(address string) (provision.Node, error)
- func (p *FakeProvisioner) GetUnits(app provision.App) []provision.Unit
- func (p *FakeProvisioner) HasCName(app provision.App, cname string) bool
- func (p *FakeProvisioner) HasNodeContainer(name string, pool string) bool
- func (p *FakeProvisioner) ImageDeploy(app provision.App, img string, evt *event.Event) (string, error)
- func (p *FakeProvisioner) IsVolumeProvisioned(name, pool string) (bool, error)
- func (p *FakeProvisioner) ListNodes(addressFilter []string) ([]provision.Node, error)
- func (p *FakeProvisioner) NodeForNodeData(nodeData provision.NodeStatusData) (provision.Node, error)
- 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) RebalanceNodes(opts provision.RebalanceNodesOptions) (bool, error)
- func (p *FakeProvisioner) Rebuild(app provision.App, evt *event.Event) (string, error)
- func (p *FakeProvisioner) RegisterUnit(a provision.App, unitId string, customData map[string]interface{}) error
- func (p *FakeProvisioner) RemoveNode(opts provision.RemoveNodeOptions) error
- func (p *FakeProvisioner) RemoveNodeContainer(name string, pool string, writer io.Writer) 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(a provision.App, process string) int
- func (p *FakeProvisioner) Rollback(app provision.App, img string, evt *event.Event) (string, error)
- func (p *FakeProvisioner) RoutableAddresses(app provision.App) ([]url.URL, 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) Sleep(app provision.App, process string) error
- func (p *FakeProvisioner) Sleeps(app provision.App, process string) int
- 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, cnameOnly bool) error
- func (p *FakeProvisioner) Units(apps ...provision.App) ([]provision.Unit, error)
- func (p *FakeProvisioner) UnsetCName(app provision.App, cname string) error
- func (p *FakeProvisioner) UpdateApp(old, new provision.App, w io.Writer) error
- func (p *FakeProvisioner) UpdateNode(opts provision.UpdateNodeOptions) error
- func (p *FakeProvisioner) UpgradeNodeContainer(name string, pool string, writer io.Writer) error
- func (p *FakeProvisioner) UploadDeploy(app provision.App, file io.ReadCloser, fileSize int64, build bool, ...) (string, error)
- type Hijacker
- type PipelineErrorFakeProvisioner
- type PipelineFakeProvisioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeApp ¶
type FakeApp struct { IP string Commands []string Memory int64 Swap int64 Deploys uint Pool string UpdatePlatform bool TeamOwner string Teams []string Quota quota.Quota // contains filtered or unexported fields }
Fake implementation for provision.App.
func NewFakeApp ¶
func NewFakeAppWithPool ¶
func (*FakeApp) AddInstance ¶
func (a *FakeApp) AddInstance(instanceArgs bind.AddInstanceArgs) error
func (*FakeApp) GetAddresses ¶
func (*FakeApp) GetCommands ¶
func (*FakeApp) GetCpuShare ¶
func (*FakeApp) GetDeploys ¶
func (*FakeApp) GetPlatform ¶
func (*FakeApp) GetPlatformVersion ¶
func (*FakeApp) GetRouters ¶
func (*FakeApp) GetServiceEnvs ¶
func (a *FakeApp) GetServiceEnvs() []bind.ServiceEnvVar
func (*FakeApp) GetTeamOwner ¶
func (*FakeApp) GetTeamsName ¶
func (*FakeApp) GetUpdatePlatform ¶
func (*FakeApp) RemoveInstance ¶
func (a *FakeApp) RemoveInstance(instanceArgs bind.RemoveInstanceArgs) error
func (*FakeApp) SetQuotaInUse ¶
type FakeConn ¶
func (*FakeConn) RemoteAddr ¶
type FakeNode ¶
type FakeNode struct { ID string Addr string PoolName string Meta map[string]string // contains filtered or unexported fields }
func (*FakeNode) FailureCount ¶
func (*FakeNode) HasSuccess ¶
func (*FakeNode) MetadataNoPrefix ¶
func (*FakeNode) Provisioner ¶
func (n *FakeNode) Provisioner() provision.NodeProvisioner
func (*FakeNode) ResetFailures ¶
func (n *FakeNode) ResetFailures()
type FakeProvisioner ¶
type FakeProvisioner struct { Name string // contains filtered or unexported fields }
Fake implementation for provision.Provisioner.
var (
ProvisionerInstance *FakeProvisioner
)
func NewFakeProvisioner ¶
func NewFakeProvisioner() *FakeProvisioner
func (*FakeProvisioner) AddNode ¶
func (p *FakeProvisioner) AddNode(opts provision.AddNodeOptions) error
func (*FakeProvisioner) AddUnit ¶
func (p *FakeProvisioner) AddUnit(app provision.App, unit provision.Unit)
func (*FakeProvisioner) AddUnitsToNode ¶
func (*FakeProvisioner) AllExecs ¶
func (p *FakeProvisioner) AllExecs() map[string][]provision.ExecOptions
AllExecs return all exec calls to all units.
func (*FakeProvisioner) ArchiveDeploy ¶
func (*FakeProvisioner) CleanImage ¶
func (p *FakeProvisioner) CleanImage(appName, imgName string) error
func (*FakeProvisioner) CustomData ¶
func (p *FakeProvisioner) CustomData(app provision.App) map[string]interface{}
func (*FakeProvisioner) DeleteVolume ¶
func (p *FakeProvisioner) DeleteVolume(volName, pool string) error
func (*FakeProvisioner) Execs ¶
func (p *FakeProvisioner) Execs(unit string) []provision.ExecOptions
Execs return all exec calls to the given unit.
func (*FakeProvisioner) ExecuteCommand ¶
func (p *FakeProvisioner) ExecuteCommand(opts provision.ExecOptions) error
func (*FakeProvisioner) FilterAppsByUnitStatus ¶
func (*FakeProvisioner) GetAppFromUnitID ¶
func (p *FakeProvisioner) GetAppFromUnitID(unitID string) (provision.App, error)
GetAppFromUnitID returns an app from unitID
func (*FakeProvisioner) GetClient ¶
func (p *FakeProvisioner) GetClient(app provision.App) (provision.BuilderDockerClient, error)
func (*FakeProvisioner) GetName ¶
func (p *FakeProvisioner) GetName() string
func (*FakeProvisioner) GetNode ¶
func (p *FakeProvisioner) GetNode(address string) (provision.Node, error)
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) HasNodeContainer ¶
func (p *FakeProvisioner) HasNodeContainer(name string, pool string) bool
func (*FakeProvisioner) ImageDeploy ¶
func (*FakeProvisioner) IsVolumeProvisioned ¶
func (p *FakeProvisioner) IsVolumeProvisioned(name, pool string) (bool, error)
func (*FakeProvisioner) ListNodes ¶
func (p *FakeProvisioner) ListNodes(addressFilter []string) ([]provision.Node, error)
func (*FakeProvisioner) NodeForNodeData ¶
func (p *FakeProvisioner) NodeForNodeData(nodeData provision.NodeStatusData) (provision.Node, error)
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) RebalanceNodes ¶
func (p *FakeProvisioner) RebalanceNodes(opts provision.RebalanceNodesOptions) (bool, error)
func (*FakeProvisioner) RegisterUnit ¶
func (*FakeProvisioner) RemoveNode ¶
func (p *FakeProvisioner) RemoveNode(opts provision.RemoveNodeOptions) error
func (*FakeProvisioner) RemoveNodeContainer ¶
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(a provision.App, process string) int
Restarts returns the number of restarts for a given app.
func (*FakeProvisioner) RoutableAddresses ¶
func (*FakeProvisioner) SetCName ¶
func (p *FakeProvisioner) SetCName(app provision.App, cname string) error
func (*FakeProvisioner) SetUnitStatus ¶
func (*FakeProvisioner) Sleep ¶
func (p *FakeProvisioner) Sleep(app provision.App, process string) error
func (*FakeProvisioner) Sleeps ¶
func (p *FakeProvisioner) Sleeps(app provision.App, process string) int
Sleeps returns the number of sleeps for a given app.
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) Swap ¶
func (p *FakeProvisioner) Swap(app1, app2 provision.App, cnameOnly bool) error
func (*FakeProvisioner) UnsetCName ¶
func (p *FakeProvisioner) UnsetCName(app provision.App, cname string) error
func (*FakeProvisioner) UpdateNode ¶
func (p *FakeProvisioner) UpdateNode(opts provision.UpdateNodeOptions) error
func (*FakeProvisioner) UpgradeNodeContainer ¶
func (*FakeProvisioner) UploadDeploy ¶
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