Documentation
¶
Index ¶
- type ErrHttpError
- type Http
- func (h *Http) Changelog(from, to string) *result.Changelogs
- func (h *Http) Condition(_ context.Context, source string, scm scm.ScmHandler) (pass bool, message string, err error)
- func (h *Http) ReportConfig() interface{}
- func (h *Http) Source(_ context.Context, workingDir string, resultSource *result.Source) error
- func (h *Http) Target(_ context.Context, source string, scm scm.ScmHandler, dryRun bool, ...) error
- type Request
- type ResponseAsserts
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrHttpError ¶
type ErrHttpError struct {
// contains filtered or unexported fields
}
func (*ErrHttpError) Error ¶
func (e *ErrHttpError) Error() string
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
Http defines a resource of type "http"
func New ¶
* New returns a reference to a newly initialized Http resource or an error if the provided Spec triggers a validation error. *
func (*Http) Changelog ¶
func (h *Http) Changelog(from, to string) *result.Changelogs
Changelog returns the changelog for this resource, or an empty string if not supported
func (*Http) Condition ¶
func (h *Http) Condition(_ context.Context, source string, scm scm.ScmHandler) (pass bool, message string, err error)
Condition tests if the response of the specified HTTP request meets assertion. If no assertion is specified, it only checks for successful HTTP response code (HTTP/1xx, HTTP/2xx or HTTP/3xx).
func (*Http) ReportConfig ¶ added in v0.99.0
func (h *Http) ReportConfig() interface{}
ReportConfig returns a new configuration object with only the necessary fields to identify the resource without any sensitive information or context specific data.
type Request ¶
type Request struct {
/*
[S][C] Specifies a custom HTTP request verb. Defaults to "GET".
*/
Verb string `yaml:",omitempty"`
/*
[S][C] Specifies a custom HTTP request body. Required with POST, PUT, PATCH.
*/
Body string `yaml:",omitempty"`
/*
[S][C] Specifies custom HTTP request headers. Defaults to an empty map.
*/
Headers map[string]string `yaml:",inline,omitempty"`
/*
[S][C] Specifies whether or not to follow redirects. Default to false (e.g. follow HTTP redirections) unless spec.returnresponseheader is set to true (source only).
*/
NoFollowRedirects bool `yaml:",omitempty"`
}
type ResponseAsserts ¶
type Spec ¶
type Spec struct {
/*
[S][C] Specifies the URL of the HTTP request for this resource.
*/
Url string `yaml:",omitempty"`
/*
[S] Specifies the header to return as source value (instead of the body).
*/
ReturnResponseHeader string
/*
[S][C] Customizes the HTTP request to emit.
*/
Request Request
/*
[C] Specifies a set of custom assertions on the HTTP response for the condition.
*/
ResponseAsserts ResponseAsserts
}
Spec defines a specification for a "http" resource parsed from an updatecli manifest file.