http

package
v0.0.0-...-c876855 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ValueRouteName = 1
)

Variables

View Source
var (
	ErrRequestFinished = "request has been finished"
	ErrFilterDestroyed = "golang filter has been destroyed"
	ErrNotInGo         = "not proccessing Go"
	ErrInvalidPhase    = "invalid phase, maybe headers/buffer already continued"
)

panic error messages when C API return not ok

View Source
var ErrDupRequestKey = errors.New("dup request key")
View Source
var Requests = &requestMap{}

Functions

func PassThroughFactory

func PassThroughFactory(interface{}) api.HttpFilterFactory

func RegisterHttpFilterConfigFactory

func RegisterHttpFilterConfigFactory(f api.HttpFilterConfigFactory)

func RegisterHttpFilterConfigParser

func RegisterHttpFilterConfigParser(parser api.HttpFilterConfigParser)

func RegisterStreamingHttpFilterConfigFactory

func RegisterStreamingHttpFilterConfigFactory(f api.HttpFilterConfigFactory)

streaming and async supported by default

func SetHttpCAPI

func SetHttpCAPI(api HttpCAPI)

SetHttpCAPI for mock cAPI

Types

type HttpCAPI

type HttpCAPI interface {
	HttpContinue(r *httpRequest, status uint64)
	HttpSendLocalReply(r *httpRequest, responseCode int, bodyText string, headers map[string]string, grpcStatus int64, details string)

	// experience api, memory unsafe
	HttpGetHeader(r *httpRequest, key *string, value *string)
	HttpCopyHeaders(r *httpRequest, num uint64, bytes uint64) map[string][]string
	HttpSetHeader(r *httpRequest, key *string, value *string, add bool)
	HttpRemoveHeader(r *httpRequest, key *string)

	HttpGetBuffer(r *httpRequest, bufferPtr uint64, value *string, length uint64)
	HttpSetBufferHelper(r *httpRequest, bufferPtr uint64, value string, action api.BufferAction)

	HttpCopyTrailers(r *httpRequest, num uint64, bytes uint64) map[string][]string
	HttpSetTrailer(r *httpRequest, key *string, value *string)

	HttpGetRouteName(r *httpRequest) string

	HttpGetDynamicMetadata(r *httpRequest, filterName string) map[string]interface{}
	HttpSetDynamicMetadata(r *httpRequest, filterName string, key string, value interface{})

	HttpFinalize(r *httpRequest, reason int)
}

declare this interface in http module, since it depends on the httpRequest struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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