operation

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOperationID

func GenerateOperationID(method string, path string) string

Types

type Operation

type Operation struct {
	*request.Client `json:"-" yaml:"-"`

	OpenAPIDocPath *string `json:"-" yaml:"-"`
	ID             string  `json:"id" yaml:"id"`

	Method          string                 `json:"method" yaml:"method"`
	URL             url.URL                `json:"url" yaml:"url"`
	Body            []byte                 `json:"body,omitempty" yaml:"body,omitempty"`
	Cookies         []*http.Cookie         `json:"cookies,omitempty" yaml:"cookies,omitempty"`
	Header          http.Header            `json:"header,omitempty" yaml:"header,omitempty"`
	SecuritySchemes []*auth.SecurityScheme `json:"securitySchemes" yaml:"securitySchemes"`
}

func MustNewOperation

func MustNewOperation(method string, operationUrl string, body *bytes.Buffer, client *request.Client) *Operation

func NewOperation

func NewOperation(method string, operationUrl string, body io.Reader, client *request.Client) (*Operation, error)

func NewOperationFromHTTPRequest added in v0.10.0

func NewOperationFromHTTPRequest(r *http.Request) (*Operation, error)

NewOperationFromHTTPRequest builds an Operation from a plain *http.Request (e.g. one built via probe.NewRequest), reading its body into memory so the Operation can be replayed via NewHTTPRequest.

func (*Operation) Clone

func (o *Operation) Clone() (*Operation, error)

func (*Operation) GenerateID

func (operation *Operation) GenerateID() *Operation

func (*Operation) GetID

func (operation *Operation) GetID() string

func (*Operation) GetOpenAPIDocPath

func (operation *Operation) GetOpenAPIDocPath() *string

func (*Operation) GetPath

func (operation *Operation) GetPath() string

func (*Operation) GetSecurityScheme

func (operation *Operation) GetSecurityScheme() *auth.SecurityScheme

func (*Operation) GetSecuritySchemes

func (operation *Operation) GetSecuritySchemes() []*auth.SecurityScheme

func (*Operation) HTTPClient added in v0.10.0

func (operation *Operation) HTTPClient() *http.Client

HTTPClient returns the *http.Client this operation's requests should be sent through.

func (*Operation) IsReachable

func (operation *Operation) IsReachable() error

func (*Operation) NewHTTPRequest added in v0.10.0

func (operation *Operation) NewHTTPRequest(ctx context.Context, mutators ...probe.RequestMutator) (*http.Request, error)

NewHTTPRequest builds a plain *http.Request for this operation via probe.NewRequest, applying the operation's own headers/cookies plus any extra mutators (e.g. auth.RequestMutators for a security scheme).

func (*Operation) SetID

func (operation *Operation) SetID(id string) *Operation

func (*Operation) SetSecuritySchemes

func (operation *Operation) SetSecuritySchemes(securitySchemes []*auth.SecurityScheme) *Operation

func (*Operation) WithCookies

func (operation *Operation) WithCookies(cookies []*http.Cookie) *Operation

func (*Operation) WithHeader

func (operation *Operation) WithHeader(header http.Header) *Operation

func (*Operation) WithOpenapiOperation

func (operation *Operation) WithOpenapiOperation(docPath string, openapiOperation *openapi3.Operation) *Operation

type Operations

type Operations []*Operation

Jump to

Keyboard shortcuts

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