body

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONMapPatchModifier added in v0.4.3

type JSONMapPatchModifier struct {
	// contains filtered or unexported fields
}

JSONMapPatchModifier let you change the name of the fields of the generated responses

func NewJSONMapPatchModifier added in v0.4.3

func NewJSONMapPatchModifier(patch *jsonpatch.Patch, options *jsonpatch.ApplyOptions, path string, substituteParams bool) *JSONMapPatchModifier

NewJSONMapPatchModifier constructs and returns a body.JSONPatchModifier.

func (*JSONMapPatchModifier) ModifyRequest added in v0.4.3

func (m *JSONMapPatchModifier) ModifyRequest(req *http.Request) error

ModifyRequest patches the request body.

func (*JSONMapPatchModifier) ModifyResponse added in v0.4.3

func (m *JSONMapPatchModifier) ModifyResponse(res *http.Response) error

ModifyResponse patches the response body.

type JSONPatchModifier

type JSONPatchModifier struct {
	// contains filtered or unexported fields
}

JSONPatchModifier let you change the name of the fields of the generated responses

func NewJSONPatchModifier

func NewJSONPatchModifier(patch *jsonpatch.Patch, options *jsonpatch.ApplyOptions, substituteParams bool) *JSONPatchModifier

NewJSONPatchModifier constructs and returns a body.JSONPatchModifier.

func (*JSONPatchModifier) ModifyRequest

func (m *JSONPatchModifier) ModifyRequest(req *http.Request) error

ModifyRequest patches the request body.

func (*JSONPatchModifier) ModifyResponse

func (m *JSONPatchModifier) ModifyResponse(res *http.Response) error

ModifyResponse patches the response body.

type JSONResource

type JSONResource struct {
	// contains filtered or unexported fields
}

JSONResource let you change the name of the fields of the generated responses

func NewJSONResource

func NewJSONResource(method string, resourceURLStr string, behavior string, group string, allowedHeaders []string) (*JSONResource, error)

NewJSONResource constructs and returns a body.JSONDataSourceModifier.

func (*JSONResource) FetchResource added in v0.2.0

func (m *JSONResource) FetchResource(downstreamReq *http.Request) (martian.ResponseModifier, error)

FetchResource fetches the resource

func (*JSONResource) ModifyResponse

func (m *JSONResource) ModifyResponse(res *http.Response) error

ModifyResponse patches the response body.

func (*JSONResource) ResetResponseVerifications added in v0.2.0

func (m *JSONResource) ResetResponseVerifications()

ResetResponseVerifications clears all failed response verifications.

func (*JSONResource) SetRequestModifier added in v0.2.0

func (m *JSONResource) SetRequestModifier(reqmod martian.RequestModifier)

SetRequestModifier Sets a RequestModifier

func (*JSONResource) SetResponseModifier added in v0.2.0

func (m *JSONResource) SetResponseModifier(resmod martian.ResponseModifier)

SetResponseModifier Sets a ResponseModifier

func (*JSONResource) VerifyResponses added in v0.2.0

func (m *JSONResource) VerifyResponses() error

VerifyResponses returns a MultiError containing all the verification errors returned by response verifiers.

type MultiFetcher added in v0.2.0

type MultiFetcher struct {
	// contains filtered or unexported fields
}

MultiFetcher let you change the name of the fields of the generated responses

func NewMultiFetcher added in v0.2.0

func NewMultiFetcher(fetchers []ResourceFetcher) *MultiFetcher

NewMultiFetcher constructs and returns a body.JSONDataSourceModifier.

func (*MultiFetcher) ModifyResponse added in v0.2.0

func (m *MultiFetcher) ModifyResponse(res *http.Response) error

ModifyResponse patches the response body.

func (*MultiFetcher) ResetResponseVerifications added in v0.2.0

func (m *MultiFetcher) ResetResponseVerifications()

ResetResponseVerifications clears all failed response verifications.

func (*MultiFetcher) VerifyResponses added in v0.2.0

func (m *MultiFetcher) VerifyResponses() error

VerifyResponses returns a MultiError containing all the verification errors returned by response verifiers.

type Param added in v0.5.0

type Param string

type Pattern added in v0.5.0

type Pattern struct {
	// contains filtered or unexported fields
}

func NewPattern added in v0.5.0

func NewPattern(raw []byte) *Pattern

func (*Pattern) ReplaceParams added in v0.5.0

func (p *Pattern) ReplaceParams(body []byte, r *http.Request) []byte

type ResourceFetcher

type ResourceFetcher interface {
	verify.ResponseVerifier
	FetchResource(*http.Request) (martian.ResponseModifier, error)
}

ResourceFetcher WIP

Jump to

Keyboard shortcuts

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