http

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ProviderName is provider name for install.
	ProviderName = "http"
)

Variables

This section is empty.

Functions

func GetProviders added in v0.6.2

func GetProviders() map[string]cuexruntime.ProviderFn

GetProviders returns the providers

func GetTemplate added in v0.6.2

func GetTemplate() string

GetTemplate returns the cue template

Types

type DoParams added in v0.6.2

type DoParams = providertypes.Params[RequestVars]

DoParams is the params for http request

type DoReturns added in v0.6.2

type DoReturns = providertypes.Returns[ResponseVars]

DoReturns is the returns for http response

func Do added in v0.6.2

func Do(ctx context.Context, params *DoParams) (*DoReturns, error)

Do process http request.

type RateLimiter added in v0.6.2

type RateLimiter struct {
	Limit  int    `json:"limit"`
	Period string `json:"period"`
}

RateLimiter .

type Request added in v0.6.2

type Request struct {
	Timeout     string            `json:"timeout,omitempty"`
	Body        string            `json:"body,omitempty"`
	Header      map[string]string `json:"header,omitempty"`
	Trailer     map[string]string `json:"trailer,omitempty"`
	RateLimiter *RateLimiter      `json:"rateLimiter,omitempty"`
}

Request .

type RequestVars added in v0.6.2

type RequestVars struct {
	Method    string     `json:"method"`
	URL       string     `json:"url"`
	Request   *Request   `json:"request,omitempty"`
	TLSConfig *TLSConfig `json:"tls_config,omitempty"`
}

RequestVars is the vars for http request

type ResponseVars added in v0.6.2

type ResponseVars struct {
	Body       string      `json:"body"`
	Header     http.Header `json:"header,omitempty"`
	Trailer    http.Header `json:"trailer,omitempty"`
	StatusCode int         `json:"statusCode"`
}

ResponseVars is the vars for http response

type TLSConfig added in v0.6.2

type TLSConfig struct {
	Secret    string `json:"secret"`
	Namespace string `json:"namespace"`
}

TLSConfig .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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