Documentation
¶
Index ¶
- Constants
- type BlueGreener
- type Client
- type Controller
- type Courier
- func (c *Courier) BindService(appName, serviceName string) ([]byte, error)
- func (c *Courier) CleanUp() error
- func (c *Courier) CreateService(service, plan, name string) ([]byte, error)
- func (c *Courier) Cups(appName string, body string) ([]byte, error)
- func (c *Courier) Delete(appName string) ([]byte, error)
- func (c *Courier) DeleteRoute(domain, hostname string) ([]byte, error)
- func (c *Courier) DeleteService(serviceName string) ([]byte, error)
- func (c *Courier) Domains() ([]string, error)
- func (c *Courier) Exists(appName string) bool
- func (c *Courier) Login(foundationURL, username, password, org, space string, skipSSL bool) ([]byte, error)
- func (c *Courier) Logs(appName string) ([]byte, error)
- func (c *Courier) MapRoute(appName, domain, hostname string) ([]byte, error)
- func (c *Courier) MapRouteWithPath(appName, domain, hostname, path string) ([]byte, error)
- func (c *Courier) Push(appName, appLocation, hostname string, instances uint16) ([]byte, error)
- func (c *Courier) Rename(appName, newAppName string) ([]byte, error)
- func (c *Courier) Restage(appName string) ([]byte, error)
- func (c *Courier) UnbindService(appName, serviceName string) ([]byte, error)
- func (c *Courier) UnmapRoute(appName, domain, hostname string) ([]byte, error)
- func (c *Courier) UnmapRouteWithPath(appName, domain, hostname, path string) ([]byte, error)
- func (c *Courier) Uups(appName string, body string) ([]byte, error)
- type Creator
- func (c Creator) CreateBlueGreener() I.BlueGreener
- func (c Creator) CreateConfig() config.Config
- func (c Creator) CreateController() controller.Controller
- func (c Creator) CreateControllerHandler() *gin.Engine
- func (c Creator) CreateDeployer() I.Deployer
- func (c Creator) CreateEventManager() I.EventManager
- func (c Creator) CreateFileSystem() *afero.Afero
- func (c Creator) CreateLogger() I.Logger
- func (c Creator) CreatePrechecker() I.Prechecker
- func (c Creator) CreatePusher(deploymentInfo S.DeploymentInfo, response io.ReadWriter) (I.Pusher, error)
- func (c Creator) CreateRandomizer() I.Randomizer
- func (c Creator) CreateSilentDeployer() I.Deployer
- func (c Creator) CreateWriter() io.Writer
- type Deployer
- type Env
- type ErrorFinder
- type ErrorMatcherMock
- type EventManager
- type Executor
- type Extractor
- type Fetcher
- type Handler
- type HealthChecker
- type Prechecker
- type Pusher
- type PusherCreator
- type Randomizer
Constants ¶
const ENDPOINT = "/v2/deploy/:environment/:org/:space/:appName"
ENDPOINT is used by the handler to define the deployment endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlueGreener ¶
type BlueGreener struct {
PushCall struct {
Write string
Received struct {
Environment S.Environment
AppPath string
DeploymentInfo S.DeploymentInfo
Out io.Writer
}
Returns struct {
Error I.DeploymentError
}
}
}
BlueGreener handmade mock for tests.
func (*BlueGreener) Push ¶
func (b *BlueGreener) Push(environment S.Environment, appPath string, deploymentInfo S.DeploymentInfo, out io.ReadWriter) I.DeploymentError
Push mock method.
type Client ¶ added in v0.7.0
type Client struct {
GetCall struct {
Received struct {
URL string
}
Returns struct {
Response http.Response
Error error
}
}
}
Client handmade mock for tests.
type Controller ¶
type Controller struct {
RunDeploymentCall struct {
Called bool
Received struct {
Deployment *I.Deployment
Response *bytes.Buffer
UUID string
}
Write struct {
Output string
}
Returns I.DeployResponse
}
RunDeploymentViaHttpCall struct {
Called bool
Received struct {
Context *gin.Context
}
}
}
func (*Controller) RunDeployment ¶
func (c *Controller) RunDeployment(deployment *I.Deployment, response *bytes.Buffer) I.DeployResponse
func (*Controller) RunDeploymentViaHttp ¶
func (c *Controller) RunDeploymentViaHttp(g *gin.Context)
type Courier ¶
type Courier struct {
TimesCourierCalled int
LoginCall struct {
Received struct {
FoundationURL string
Username string
Password string
Org string
Space string
SkipSSL bool
}
Returns struct {
Output []byte
Error error
}
}
DeleteCall struct {
Received struct {
AppName string
}
Returns struct {
Output []byte
Error error
}
}
PushCall struct {
Received struct {
AppName string
AppPath string
Hostname string
Instances uint16
}
Returns struct {
Output []byte
Error error
}
}
RenameCall struct {
Received struct {
AppName string
AppNameVenerable string
}
Returns struct {
Output []byte
Error error
}
}
LogsCall struct {
Received struct {
AppName string
}
Returns struct {
Output []byte
Error error
}
}
MapRouteWithPathCall struct {
TimesCalled int
Received struct {
AppName []string
Domain []string
Hostname []string
Path []string
}
Returns struct {
Output [][]byte
Error []error
}
}
MapRouteCall struct {
TimesCalled int
Received struct {
AppName []string
Domain []string
Hostname []string
}
Returns struct {
Output [][]byte
Error []error
}
}
UnmapRouteCall struct {
OrderCalled int
Received struct {
AppName string
Domain string
Hostname string
}
Returns struct {
Output []byte
Error error
}
}
DeleteRouteCall struct {
OrderCalled int
Received struct {
Domain string
Hostname string
}
Returns struct {
Output []byte
Error error
}
}
CreateServiceCall struct {
}
ExistsCall struct {
Received struct {
AppName string
}
Returns struct {
Bool bool
}
}
CupsCall struct {
Received struct {
AppName string
Body string
}
Returns struct {
Output []byte
Error error
}
}
UupsCall struct {
Received struct {
AppName string
Body string
}
Returns struct {
Output []byte
Error error
}
}
DomainsCall struct {
TimesCalled int
Returns struct {
Domains []string
Error error
}
}
CleanUpCall struct {
Returns struct {
Error error
}
}
}
Courier handmade mock for tests.
func (*Courier) BindService ¶
func (*Courier) CreateService ¶
func (*Courier) DeleteRoute ¶
DeleteRoute mock method.
func (*Courier) Login ¶
func (c *Courier) Login(foundationURL, username, password, org, space string, skipSSL bool) ([]byte, error)
Login mock method.
func (*Courier) MapRouteWithPath ¶
MapRoute mock method.
func (*Courier) UnbindService ¶
func (*Courier) UnmapRoute ¶ added in v0.7.0
UnmapRoute mock method.
func (*Courier) UnmapRouteWithPath ¶
type Creator ¶ added in v0.6.0
type Creator struct {
// contains filtered or unexported fields
}
Handmade Creator mock. Uses a mock prechecker to skip verifying the foundations are up and running. Uses a mock Courier and Executor to mock pushing an application. Uses a mock FileSystem to mock writing to the operating system.
func NewCreator ¶ added in v0.6.0
func (Creator) CreateBlueGreener ¶ added in v0.6.0
func (c Creator) CreateBlueGreener() I.BlueGreener
func (Creator) CreateConfig ¶ added in v0.6.0
func (Creator) CreateController ¶ added in v0.6.0
func (c Creator) CreateController() controller.Controller
func (Creator) CreateControllerHandler ¶ added in v0.6.0
func (Creator) CreateDeployer ¶ added in v0.6.0
func (Creator) CreateEventManager ¶ added in v0.6.0
func (c Creator) CreateEventManager() I.EventManager
func (Creator) CreateFileSystem ¶ added in v0.6.0
func (Creator) CreateLogger ¶ added in v0.6.0
func (Creator) CreatePrechecker ¶ added in v0.6.0
func (c Creator) CreatePrechecker() I.Prechecker
func (Creator) CreatePusher ¶ added in v0.6.0
func (c Creator) CreatePusher(deploymentInfo S.DeploymentInfo, response io.ReadWriter) (I.Pusher, error)
func (Creator) CreateRandomizer ¶ added in v0.6.0
func (c Creator) CreateRandomizer() I.Randomizer
func (Creator) CreateSilentDeployer ¶
func (Creator) CreateWriter ¶ added in v0.6.0
type Deployer ¶
type Deployer struct {
DeployCall struct {
Called int
Received struct {
Request *http.Request
Environment string
Org string
Space string
AppName string
UUID string
ContentType I.DeploymentType
Response io.ReadWriter
}
Write struct {
Output string
}
Returns struct {
Error error
StatusCode int
}
}
}
Deployer handmade mock for tests.
func (*Deployer) Deploy ¶
func (d *Deployer) Deploy(req *http.Request, environment, org, space, appName, uuid string, contentType I.DeploymentType, out io.ReadWriter, reqChan chan I.DeployResponse)
Deploy mock method.
type Env ¶
type Env struct {
GetCall struct {
Received struct {
Keys []string
}
Returns struct {
Values map[string]string
}
}
}
Env handmade mock for tests.
type ErrorFinder ¶
type ErrorFinder struct {
FindErrorsCall struct {
Received struct {
Response string
}
Returns struct {
Errors []interfaces.LogMatchedError
}
}
}
func (*ErrorFinder) FindErrors ¶
func (e *ErrorFinder) FindErrors(responseString string) []interfaces.LogMatchedError
type ErrorMatcherMock ¶
type ErrorMatcherMock struct {
MatchCall struct {
Returns interfaces.LogMatchedError
}
DescriptorCall struct {
Returns string
}
}
func (*ErrorMatcherMock) Descriptor ¶
func (m *ErrorMatcherMock) Descriptor() string
func (*ErrorMatcherMock) Match ¶
func (m *ErrorMatcherMock) Match(matchTo []byte) interfaces.LogMatchedError
type EventManager ¶
type EventManager struct {
AddHandlerCall struct {
Received struct {
Handler I.Handler
EventType string
}
Returns struct {
Error error
}
}
EmitCall struct {
TimesCalled int
Received struct {
Events []I.Event
}
Returns struct {
Error []error
}
}
}
EventManager handmade mock for tests.
func (*EventManager) AddHandler ¶
func (e *EventManager) AddHandler(handler I.Handler, eventType string) error
AddHandler mock method.
type Executor ¶
type Executor struct {
ExecuteCall struct {
Received struct {
Args []string
}
Returns struct {
Output []byte
Error error
}
}
ExecuteInDirectoryCall struct {
Received struct {
AppLocation string
Args []string
}
Returns struct {
Output []byte
Error error
}
}
CleanUpCall struct {
Returns struct {
Error error
}
}
}
Executor handmade mock for tests.
type Extractor ¶
type Extractor struct {
UnzipCall struct {
Received struct {
Source string
Destination string
Manifest string
}
Returns struct {
Error error
}
}
}
Extractor handmade mock for tests.
type Fetcher ¶
type Fetcher struct {
FetchCall struct {
Received struct {
ArtifactURL string
Manifest string
}
Returns struct {
AppPath string
Error error
}
}
FetchFromZipCall struct {
Received struct {
Request *http.Request
}
Returns struct {
AppPath string
Error error
}
}
}
Fetcher handmade mock for tests.
type Handler ¶
type Handler struct {
OnEventCall struct {
Received struct {
Event I.Event
}
Returns struct {
Error error
}
}
}
Handler handmade mock for tests.
type HealthChecker ¶ added in v0.7.0
type HealthChecker struct {
CheckCall struct {
Received struct {
Endpoint string
URL string
}
Returns struct {
Error error
}
}
}
HealthChecker handmade mock for tests.
func (*HealthChecker) Check ¶ added in v0.7.0
func (h *HealthChecker) Check(endpoint, serverURL string) error
type Prechecker ¶
type Prechecker struct {
AssertAllFoundationsUpCall struct {
Received struct {
Environment S.Environment
}
Returns struct {
Error error
}
}
}
Prechecker handmade mock for tests.
func (*Prechecker) AssertAllFoundationsUp ¶
func (p *Prechecker) AssertAllFoundationsUp(environment S.Environment) error
AssertAllFoundationsUp mock method.
type Pusher ¶
type Pusher struct {
Response io.ReadWriter
LoginCall struct {
Received struct {
FoundationURL string
}
Write struct {
Output string
}
Returns struct {
Error error
}
}
PushCall struct {
Received struct {
AppPath string
FoundationURL string
AppExists bool
Out io.ReadWriter
}
Write struct {
Output string
}
Returns struct {
Error error
}
}
UndoPushCall struct {
Received struct {
AppExists bool
UndoPushWasCalled bool
}
Returns struct {
Error error
}
}
FinishPushCall struct {
Returns struct {
Error error
}
}
CleanUpCall struct {
Returns struct {
Error error
}
}
}
Pusher handmade mock for tests.
type PusherCreator ¶
type PusherCreator struct {
CreatePusherCall struct {
TimesCalled int
Returns struct {
Pushers []interfaces.Pusher
Error []error
}
}
}
PusherCreator handmade mock for tests.
func (*PusherCreator) CreatePusher ¶
func (p *PusherCreator) CreatePusher(deploymentInfo S.DeploymentInfo, response io.ReadWriter) (interfaces.Pusher, error)
CreatePusher mock method.
type Randomizer ¶
type Randomizer struct {
RandomizeCall struct {
Received struct {
Length int
}
Returns struct {
Runes string
}
}
}
Randomizer handmade mock for tests.
func (*Randomizer) StringRunes ¶
func (r *Randomizer) StringRunes(length int) string
StringRunes mock method.