client

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	validation.Validatable `json:"-"`
	Name                   string           `json:"name"          yaml:"Name"`
	Method                 http.Method      `json:"method"        yaml:"Method"`
	Path                   string           `json:"path"          yaml:"Path"`
	Description            string           `json:"description"   yaml:"Description"`
	Documentation          string           `json:"documentation" yaml:"Documentation"`
	Deprecated             string           `json:"deprecated"    yaml:"Deprecated"`
	Labels                 data.Map[string] `json:"labels"        yaml:"Labels"`
	Headers                http.Headers     `json:"headers"       yaml:"Headers"`
	Payload                any              `json:"payload"       yaml:"Payload"`
	Expect                 *Expect          `json:"expect"        yaml:"Expect"`
}

Endpoint is an HTTP client endpoint.

func (*Endpoint) Validate

func (e *Endpoint) Validate() error

Validate makes Endpoint validatable by implementing validation.Validatable interface.

type Endpoints

type Endpoints []*Endpoint

Endpoints represents the http client endpoints.

type Expect

type Expect struct {
	Status  http.Status  `json:"status"  yaml:"Status"`
	Headers http.Headers `json:"headers" yaml:"Headers"`
}

Expect is an HTTP response expectation.

func NewExpect

func NewExpect(headers http.Headers) *Expect

NewExpect creates a new Expect.

func (*Expect) Validate

func (e *Expect) Validate(status http.Status, headers http.Headers) error

Validate validates the given response.

func (*Expect) ValidateHeader

func (e *Expect) ValidateHeader(headers http.Headers) error

ValidateHeader validates the headers of the given response.

func (*Expect) ValidateStatus

func (e *Expect) ValidateStatus(status http.Status) error

ValidateStatus validates the status code of the given response.

Jump to

Keyboard shortcuts

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