http

package
v0.0.0-...-09e6e34 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxRequestBodySize = 4 * 1024 * 1024
View Source
const DefaultReadBufferSize = 16 * 1024
View Source
const InternalHealthPath = "/__internal/health"

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	trigger.Configuration
	ReadBufferSize int

	// NOTE: Modifying the max request body size affect with gradually memory consumption increasing
	// as the entire request being read into the memory
	// https://github.com/valyala/fasthttp/issues/667#issuecomment-540965683
	MaxRequestBodySize int
	ReduceMemoryUsage  bool
	CORS               *cors.CORS

	// Used to disable port publishing for the HTTP trigger on docker platform
	DisablePortPublishing bool
}

func NewConfiguration

func NewConfiguration(id string,
	triggerConfiguration *functionconfig.Trigger,
	runtimeConfiguration *runtime.Configuration) (*Configuration, error)

type Event

type Event struct {
	nuclio.AbstractEvent
	// contains filtered or unexported fields
}

allows accessing fasthttp.RequestCtx as a event.Sync

func (*Event) GetBody

func (e *Event) GetBody() []byte

GetBody returns the body of the event

func (*Event) GetContentType

func (e *Event) GetContentType() string

GetContentType returns the content type of the body

func (*Event) GetFieldByteSlice

func (e *Event) GetFieldByteSlice(key string) []byte

GetFieldByteSlice returns the field by name as a byte slice

func (*Event) GetFieldInt

func (e *Event) GetFieldInt(key string) (int, error)

GetFieldInt returns the field by name as an integer

func (*Event) GetFieldString

func (e *Event) GetFieldString(key string) string

GetFieldString returns the field by name as a string

func (*Event) GetFields

func (e *Event) GetFields() map[string]interface{}

GetFields loads all fields into a map of string / interface{}

func (*Event) GetHeader

func (e *Event) GetHeader(key string) interface{}

GetHeader returns the header by name as an interface{}

func (*Event) GetHeaderByteSlice

func (e *Event) GetHeaderByteSlice(key string) []byte

GetHeaderByteSlice returns the header by name as a byte slice

func (*Event) GetHeaderString

func (e *Event) GetHeaderString(key string) string

GetHeaderString returns the header by name as a string

func (*Event) GetHeaders

func (e *Event) GetHeaders() map[string]interface{}

GetHeaders loads all headers into a map of string / interface{}

func (*Event) GetMethod

func (e *Event) GetMethod() string

GetPath returns the method of the event, if applicable

func (*Event) GetPath

func (e *Event) GetPath() string

GetPath returns the path of the event

func (*Event) GetTimestamp

func (e *Event) GetTimestamp() time.Time

GetTimestamp returns when the event originated

type FastHTTPLogger

type FastHTTPLogger struct {
	// contains filtered or unexported fields
}

func NewFastHTTPLogger

func NewFastHTTPLogger(parentLogger logger.Logger) FastHTTPLogger

func (FastHTTPLogger) Printf

func (s FastHTTPLogger) Printf(format string, args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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