Documentation
¶
Index ¶
- Constants
- func AddStreamedResponseBody(responses []*eppb.ProcessingResponse, responseBodyBytes []byte) []*eppb.ProcessingResponse
- func BuildChunkedBodyResponses(bodyBytes []byte, setEos bool) []*extProcPb.CommonResponse
- func ExtractHeaderValue(req *extProcPb.ProcessingRequest_RequestHeaders, headerKey string) string
- func ExtractMetadataValues(req *extProcPb.ProcessingRequest) map[string]any
- func GenerateHeadersMutation(headers map[string]string) []*corev3.HeaderValueOption
- func GenerateRequestBodyResponses(requestBodyBytes []byte) []*extProcPb.ProcessingResponse
- func GetHeaderValue(header *corev3.HeaderValue) string
Constants ¶
const ( // BodyByteLimit is the max limit of 62Kb per streamed chunk. // Certain envoy implementations set a max limit of 64Kb per streamed chunk, intentionally setting this lower for a safe margin. BodyByteLimit = 62000 )
Variables ¶
This section is empty.
Functions ¶
func AddStreamedResponseBody ¶
func AddStreamedResponseBody(responses []*eppb.ProcessingResponse, responseBodyBytes []byte) []*eppb.ProcessingResponse
AddStreamedResponseBody splits responseBodyBytes into chunked body responses and appends them as ResponseBody ProcessingResponses, mirroring GenerateRequestBodyResponses for the request path.
func BuildChunkedBodyResponses ¶
func BuildChunkedBodyResponses(bodyBytes []byte, setEos bool) []*extProcPb.CommonResponse
BuildChunkedBodyResponses splits the bodyBytes into chunks of size BodyByteLimit and returns a slice of CommonResponse. If setEos is true, the last chunk will have EndOfStream set to true.
func ExtractHeaderValue ¶
func ExtractHeaderValue(req *extProcPb.ProcessingRequest_RequestHeaders, headerKey string) string
ExtractHeaderValue searches for a specific header key in the processing request and returns its value. The lookup is case-insensitive. Returns an empty string if the header is missing or if the request structure is nil.
func ExtractMetadataValues ¶
func ExtractMetadataValues(req *extProcPb.ProcessingRequest) map[string]any
func GenerateHeadersMutation ¶
func GenerateHeadersMutation(headers map[string]string) []*corev3.HeaderValueOption
func GenerateRequestBodyResponses ¶
func GenerateRequestBodyResponses(requestBodyBytes []byte) []*extProcPb.ProcessingResponse
GenerateRequestBodyResponses splits the request body bytes into chunked body responses and wraps each chunk in a ProcessingResponse_RequestBody envelope.
func GetHeaderValue ¶
func GetHeaderValue(header *corev3.HeaderValue) string
GetHeaderValue safely extracts the string value from an Envoy HeaderValue field.
Types ¶
This section is empty.