httptrigger

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRequestReadTimeout = 9 * time.Second

DefaultRequestReadTimeout for http server

View Source
const Type = "httptrigger"

Type name for http trigger

Variables

This section is empty.

Functions

This section is empty.

Types

type Operator

type Operator struct {
	*operators.BaseOperator

	// Config cors for http endpoints
	CORS struct {
		AllowedMethods []string
		AllowedHeaders []string
		AllowedOrigins []string
		ExposedHeaders []string

		MaxAge           int
		AllowCredentials bool
	}
	// contains filtered or unexported fields
}

Operator creates http based http trigger automatically for every funcs

func NewOperator

func NewOperator(
	ctx context.Context,
	cfg *rest.Config,
	rclient rfcli.Interface,
	rfInformers informers.SharedInformerFactory,
) (*Operator, error)

NewOperator creates a new http trigger operator

func (*Operator) Run

func (r *Operator) Run(stopC <-chan struct{})

Run will not return until stopC is closed.

type RequestContext added in v0.2.1

type RequestContext struct {
	DomainName string             `json:"domainName"`
	HTTP       RequestContextHTTP `json:"http"`
	RequestID  string             `json:"requestId"`
}

type RequestContextHTTP added in v0.2.1

type RequestContextHTTP struct {
	Method    string `json:"method"`
	Path      string `json:"path"`
	Protocol  string `json:"protocol"`
	SourceIP  string `json:"sourceIp"`
	UserAgent string `json:"userAgent"`
}

type RequestPayload added in v0.2.1

type RequestPayload struct {
	Version               string            `json:"version"`
	RawPath               string            `json:"rawPath"`
	RawQueryString        string            `json:"rawQueryString"`
	Cookies               []string          `json:"cookies"`
	Headers               map[string]string `json:"headers"`
	QueryStringParameters map[string]string `json:"queryStringParameters"`
	PathParameters        map[string]string `json:"pathParameters"`
	IsBase64Encoded       bool              `json:"isBase64Encoded"`
	Body                  string            `json:"body"`
	Context               RequestContext    `json:"requestContext"`
}

type ResponsePayload added in v0.2.1

type ResponsePayload struct {
	StatusCode      int               `json:"statusCode"`
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`
	Cookies         []string          `json:"cookies"`
	IsBase64Encoded bool              `json:"isBase64Encoded"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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