http

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 23 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 `json:"readBufferSize,omitempty"`

	// 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        `json:"maxRequestBodySize,omitempty"`
	ReduceMemoryUsage  bool       `json:"reduceMemoryUsage,omitempty"`
	CORS               *cors.CORS `json:"cors,omitempty"`

	// Used to disable port publishing for the HTTP trigger on docker platform
	DisablePortPublishing bool `json:"disablePortPublishing,omitempty"`

	Mode TriggerMode `json:"mode,omitempty"`
}

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{})

type TriggerMode

type TriggerMode string
const (
	TriggerModeAsync TriggerMode = "async"
	TriggerModeSync  TriggerMode = "sync"

	DefaultTriggerMode = TriggerModeSync
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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