Documentation
¶
Overview ¶
Provides a stub implementation of a Deploy Engine server. This allows for thorough testing of the client including client streaming behaviour and the various authentication methods supported by the Deploy Engine v1 API.
Index ¶
- func CreateDefaultTransport(transport *http.Transport) http.RoundTripper
- func CreateDeployEngineServer(serverConfig *TestServerConfig, stubValidationEvents []*manage.Event, ...) *httptest.Server
- func CreateFailingServer() *httptest.Server
- func CreateOAuthServer(clientID string, clientSecret string, authType string) (*httptest.Server, error)
- func NewUnixDomainSocketServer(socketPath string, handler http.Handler) *httptest.Server
- type MockClock
- type TestServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultTransport ¶
func CreateDefaultTransport(transport *http.Transport) http.RoundTripper
CreateDefaultTransport provides a function that overrides the default transport configured for a deploy engine client with the Go default HTTP transport.
func CreateFailingServer ¶
func CreateOAuthServer ¶
Types ¶
type TestServerConfig ¶
type TestServerConfig struct {
AllowedAPIKeys []string
AllowedBearerTokens []string
AllowedCeleritySignatureKeyPairs map[string]*sigv1.KeyPair
// A string that will be present in some part of the request
// to the server that will trigger behaviour to simulate
// an internal server error.
InternalServerErrorTrigger string
NetworkErrorTrigger string
DeserialiseErrorTrigger string
InternalServerErrorTriggerID string
NetworkErrorTriggerID string
DeserialiseErrorTriggerID string
FailingStreamTriggerID string
UseUnixDomainSocket bool
UnixDomainSocketPath string
}
Click to show internal directories.
Click to hide internal directories.