updateclihttp

package
v0.67.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func New(spec interface{}) (*Http, error)

* 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() string

Changelog returns the changelog for this resource, or an empty string if not supported

func (*Http) Condition

func (h *Http) Condition(source string, scm scm.ScmHandler, resultCondition *result.Condition) 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) Source

func (h *Http) Source(workingDir string, resultSource *result.Source) error

Source returns content from the response of the specified HTTP request (defaults to the body).

func (*Http) Target

func (h *Http) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error

Target is not implemented. If you ever feel the need, you can still open a GitHub issue with a valid usecase.

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. Defaults to "" (empty string).
	*/
	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 ResponseAsserts struct {
	/*
		[C] Specifies a set of assertions on the HTTP response headers.
	*/
	Headers map[string]string `yaml:",inline,omitempty"`
	/*
		[C] Specifies a custom assertion on the HTTP response status code.
	*/
	StatusCode int `yaml:",omitempty"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL