interceptor

package
v0.0.0-...-c10446a Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInterceptor

func GetInterceptor(templateValues any, templateString string) string

GetInterceptor inject values and get request interceptor Note: This method is called only if one of request or response interceptor is enabled

func GetTemplate

func GetTemplate(isReqIntercept bool, isResIntercept bool) string

GetTemplate returns the combined tempalate for the interceptor lua script

Types

type Config

type Config struct {
	Enable       bool
	ExternalCall *HTTPCallConfig
	Include      *RequestInclusions
}

Config hold config values used for request/response interceptors

type HTTPCallConfig

type HTTPCallConfig struct {
	ClusterName     string
	Timeout         string // in milli seconds
	AuthorityHeader string
}

HTTPCallConfig hold values used for external interceptor engine

type Interceptor

type Interceptor struct {
	Context               *InvocationContext
	IsRequestFlowEnabled  bool
	IsResponseFlowEnabled bool
	RequestFlow           map[string]Config // key:operation method -> value:config
	ResponseFlow          map[string]Config // key:operation method -> value:config
}

Interceptor hold values used for interceptor

type InvocationContext

type InvocationContext struct {
	OrganizationID   string
	BasePath         string
	SupportedMethods string
	APIName          string
	APIVersion       string
	PathTemplate     string
	Vhost            string
	ClusterName      string
	APIProperties    string
	Environment      string
}

InvocationContext represents static details of the invocation context of a request for the resource path runtime details such as actual path will be populated from the lua script and set in the invocation context

type RequestInclusions

type RequestInclusions struct {
	InvocationContext bool
	RequestHeaders    bool
	RequestBody       bool
	RequestTrailer    bool
	ResponseHeaders   bool
	ResponseBody      bool
	ResponseTrailers  bool
}

RequestInclusions represents which should be included in the request payload to the interceptor service

Jump to

Keyboard shortcuts

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