kong

package module
v0.0.0-...-955039e Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunContainer

func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*kongContainer, error)

RunContainer is the entrypoint to the module

func WithConfig

WithConfig adds the kong config file to the container, in the "/usr/local/kong/kong.yaml" directory of the container, and setting the KONG_DECLARATIVE_CONFIG environment variable to that path.

func WithGoPlugin

func WithGoPlugin(goPlugPath string) testcontainers.CustomizeRequestOption

WithGoPlugin adds a Go plugin to the container, in the "/usr/local/bin" directory of the container appending the plugin name to the KONG_PLUGINS and KONG_PLUGINSERVER_NAMES environment variables, and setting the KONG_PLUGINSERVER_GOPLUG_START_CMD and KONG_PLUGINSERVER_GOPLUG_QUERY_CMD to the executable path of the plugin.

func WithKongEnv

WithKongEnv sets environment variables for kong container, possibly overwriting defaults

func WithLogLevel

func WithLogLevel(level string) testcontainers.CustomizeRequestOption

WithLogLevel sets log level for kong container, using the KONG_LOG_LEVEL environment variable.

func WithWasmFilter

func WithWasmFilter(wasmFiltersPath string) testcontainers.CustomizeRequestOption

Types

type JSONResponse

type JSONResponse struct {
	StartedDateTime time.Time `json:"startedDateTime"`
	ClientIPAddress string    `json:"clientIPAddress"`
	Method          string    `json:"method"`
	URL             string    `json:"url"`
	HTTPVersion     string    `json:"httpVersion"`
	Cookies         struct {
	} `json:"cookies"`
	Headers struct {
		Host            string `json:"host"`
		Connection      string `json:"connection"`
		AcceptEncoding  string `json:"accept-encoding"`
		XForwardedFor   string `json:"x-forwarded-for"`
		CfRay           string `json:"cf-ray"`
		XForwardedProto string `json:"x-forwarded-proto"`
		CfVisitor       string `json:"cf-visitor"`
		XForwardedHost  string `json:"x-forwarded-host"`
		XForwardedPort  string `json:"x-forwarded-port"`
		XForwardedPath  string `json:"x-forwarded-path"`
		UserAgent       string `json:"user-agent"`
		CfConnectingIP  string `json:"cf-connecting-ip"`
		CdnLoop         string `json:"cdn-loop"`
		XRequestID      string `json:"x-request-id"`
		Via             string `json:"via"`
		ConnectTime     string `json:"connect-time"`
		XRequestStart   string `json:"x-request-start"`
		TotalRouteTime  string `json:"total-route-time"`
	} `json:"headers"`
	QueryString struct {
	} `json:"queryString"`
	PostData struct {
		MimeType string        `json:"mimeType"`
		Text     string        `json:"text"`
		Params   []interface{} `json:"params"`
	} `json:"postData"`
	HeadersSize int `json:"headersSize"`
	BodySize    int `json:"bodySize"`
}

JSONResponse representation of a response from mockbin service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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