request

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ContentTypeForm = "application/x-www-form-urlencoded"
	ContentTypeJSON = "application/json"
)

Variables

View Source
var ErrCancel = errors.New("request cancel by JsonNet")

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Type   string
	Config json.RawMessage
}

type AuthStrategy

type AuthStrategy interface {
	// contains filtered or unexported methods
}

type Builder

type Builder struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(config json.RawMessage, deps Dependencies) (*Builder, error)

func (*Builder) BuildRequest

func (b *Builder) BuildRequest(ctx context.Context, body interface{}) (*retryablehttp.Request, error)

type Config

type Config struct {
	Method      string      `json:"method"`
	URL         string      `json:"url"`
	TemplateURI string      `json:"body"`
	Header      http.Header `json:"headers"`
	Auth        Auth        `json:"auth,omitempty"`
}

type Dependencies added in v0.11.0

type Dependencies interface {
	x.LoggingProvider
	x.HTTPClientProvider
	jsonnetsecure.VMProvider
}

Jump to

Keyboard shortcuts

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