Documentation ¶
Index ¶
- func CreateHTTPClient(handler http.Handler) (*http.Client, func())
- func CreateHTTPSClient(handler http.Handler) (*http.Client, string, func())
- func CreateHandler(response []byte, statusCode int) http.Handler
- type CombinedURLHandler
- func (h *CombinedURLHandler) AddExactError(url string, statusCode int, fileName string)
- func (h *CombinedURLHandler) AddExactFile(url string, fileName string)
- func (h *CombinedURLHandler) AddExactTemplate(url string, templateFilename string, templatingData interface{})
- func (h *CombinedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type EmptyURLHandler
- type EventData
- func (e *EventData) GetDeployment() string
- func (e EventData) GetDeploymentStrategy() string
- func (e *EventData) GetEvent() string
- func (e *EventData) GetLabels() map[string]string
- func (e *EventData) GetProject() string
- func (e *EventData) GetService() string
- func (e *EventData) GetShKeptnContext() string
- func (e *EventData) GetSource() string
- func (e *EventData) GetStage() string
- func (e *EventData) GetTestStrategy() string
- type FileBasedURLHandler
- type FileBasedURLHandlerWithSink
- type PayloadBasedURLHandler
- type TemplatingPayloadBasedURLHandler
- func (h *TemplatingPayloadBasedURLHandler) AddExact(url string, templateFilename string, templatingData interface{})
- func (h *TemplatingPayloadBasedURLHandler) AddExactError(url string, statusCode int, templateFilename string, ...)
- func (h *TemplatingPayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPClient ¶
CreateHTTPClient create a fake http client for integration tests
func CreateHTTPSClient ¶
CreateHTTPSClient creates a test client with a httptest server that responds to API calls
Types ¶
type CombinedURLHandler ¶
type CombinedURLHandler struct {
// contains filtered or unexported fields
}
func NewCombinedURLHandler ¶
func NewCombinedURLHandler(t *testing.T) *CombinedURLHandler
func (*CombinedURLHandler) AddExactError ¶
func (h *CombinedURLHandler) AddExactError(url string, statusCode int, fileName string)
func (*CombinedURLHandler) AddExactFile ¶
func (h *CombinedURLHandler) AddExactFile(url string, fileName string)
func (*CombinedURLHandler) AddExactTemplate ¶
func (h *CombinedURLHandler) AddExactTemplate(url string, templateFilename string, templatingData interface{})
func (*CombinedURLHandler) ServeHTTP ¶
func (h *CombinedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EmptyURLHandler ¶
type EmptyURLHandler struct {
// contains filtered or unexported fields
}
EmptyURLHandler is an implementation of http.Handler that will not handle anything.
func NewEmptyURLHandler ¶
func NewEmptyURLHandler(t *testing.T) *EmptyURLHandler
NewEmptyURLHandler creates a new EmptyURLHandler instance.
func (*EmptyURLHandler) ServeHTTP ¶
func (h *EmptyURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type EventData ¶
type EventData struct { Context string Source string Event string Project string Stage string Service string Deployment string TestStrategy string DeploymentStrategy string Labels map[string]string }
func (*EventData) GetDeployment ¶
GetDeployment returns the name of the deployment
func (EventData) GetDeploymentStrategy ¶
GetDeploymentStrategy returns the used deployment strategy
func (*EventData) GetProject ¶
GetProject returns the project
func (*EventData) GetService ¶
GetService returns the service
func (*EventData) GetShKeptnContext ¶
GetShKeptnContext returns the shkeptncontext
func (*EventData) GetTestStrategy ¶
GetTestStrategy returns the used test strategy
type FileBasedURLHandler ¶
type FileBasedURLHandler struct {
// contains filtered or unexported fields
}
func NewFileBasedURLHandler ¶
func NewFileBasedURLHandler(t *testing.T) *FileBasedURLHandler
func (*FileBasedURLHandler) AddExact ¶
func (h *FileBasedURLHandler) AddExact(url string, fileName string)
func (*FileBasedURLHandler) AddExactError ¶
func (h *FileBasedURLHandler) AddExactError(url string, statusCode int, fileName string)
func (*FileBasedURLHandler) ServeHTTP ¶
func (h *FileBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FileBasedURLHandlerWithSink ¶
type FileBasedURLHandlerWithSink struct { *FileBasedURLHandler // contains filtered or unexported fields }
FileBasedURLHandlerWithSink encapsulates a FileBasedURLHandler and contains a sink for any data that would be sent to the server in the request body
func NewFileBasedURLHandlerWithSink ¶
func NewFileBasedURLHandlerWithSink(t *testing.T) *FileBasedURLHandlerWithSink
NewFileBasedURLHandlerWithSink creates a new FileBasedURLHandlerWithSink instance
func (*FileBasedURLHandlerWithSink) GetStoredPayloadForURL ¶
func (h *FileBasedURLHandlerWithSink) GetStoredPayloadForURL(url string, container interface{})
GetStoredPayloadForURL unmarshals the payload found for the exact url into the container or fails if it could not find an exact url match.
func (*FileBasedURLHandlerWithSink) ServeHTTP ¶
func (h *FileBasedURLHandlerWithSink) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PayloadBasedURLHandler ¶
type PayloadBasedURLHandler struct {
// contains filtered or unexported fields
}
func NewPayloadBasedURLHandler ¶
func NewPayloadBasedURLHandler(t *testing.T) *PayloadBasedURLHandler
func (*PayloadBasedURLHandler) AddExact ¶
func (h *PayloadBasedURLHandler) AddExact(url string, payload []byte)
func (*PayloadBasedURLHandler) AddExactError ¶
func (h *PayloadBasedURLHandler) AddExactError(url string, statusCode int, payload []byte)
func (*PayloadBasedURLHandler) ServeHTTP ¶
func (h *PayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TemplatingPayloadBasedURLHandler ¶
type TemplatingPayloadBasedURLHandler struct {
// contains filtered or unexported fields
}
TemplatingPayloadBasedURLHandler encapsulates a payload-based URL handler and extends its with templating functionality
func NewTemplatingPayloadBasedURLHandler ¶
func NewTemplatingPayloadBasedURLHandler(t *testing.T) *TemplatingPayloadBasedURLHandler
NewTemplatingPayloadBasedURLHandler creates a new TemplatingPayloadBasedURLHandler
func (*TemplatingPayloadBasedURLHandler) AddExact ¶
func (h *TemplatingPayloadBasedURLHandler) AddExact(url string, templateFilename string, templatingData interface{})
AddExact will add an exact match handler for a given url, using a template file and templatingData to produce a byte[] payload
func (*TemplatingPayloadBasedURLHandler) AddExactError ¶
func (h *TemplatingPayloadBasedURLHandler) AddExactError(url string, statusCode int, templateFilename string, templatingData interface{})
AddExactError will add an exact match error handler for a given url, including an error status code using a template file and templatingData to produce a byte[] payload
func (*TemplatingPayloadBasedURLHandler) ServeHTTP ¶
func (h *TemplatingPayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)