http

package
v0.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 23 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

func InitRateLimiter added in v0.7.3

func InitRateLimiter(ctx context.Context)

InitRateLimiter initializes the rate limiter. Must be called once at startup.

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 HeaderSecret added in v0.7.3

type HeaderSecret struct {
	Header string `json:"header"`
	Secret string `json:"secret"`
	Key    string `json:"key"`
}

HeaderSecret resolves a single HTTP header value from a Kubernetes Secret.

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"`
	HeadersFromSecret []HeaderSecret    `json:"headersFromSecret,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 .

Jump to

Keyboard shortcuts

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