request

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 20 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(ctx context.Context, config json.RawMessage, deps Dependencies, jsonnetCache *ristretto.Cache) (_ *Builder, err 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

Jump to

Keyboard shortcuts

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