kong

package
v0.47.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAPIResponse

type AdminAPIResponse struct {
	Status   int
	Body     []byte
	Callback func()
}

AdminAPIResponse represents an HTTP response from the Kong Admin API

type FakeAdminAPIServer

type FakeAdminAPIServer struct {
	// Endpoint is the (fake) HTTP server for the Kong Admin API
	Endpoint *httptest.Server

	// KongClient is a *kong.Client configured to connect with the Endpoint
	KongClient *kong.Client

	// HTTPClient is an *http.Client configured to connect with the Endpoint
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

FakeAdminAPIServer implements a basic httptest.Server which can be used as a Kong Admin API for unit tests.

func NewFakeAdminAPIServer

func NewFakeAdminAPIServer() (*FakeAdminAPIServer, error)

NewFakeAdminAPIServer provides a new *FakeAdminAPIServer which can be used for unit testing functionality that requires a *kong.Client or otherwise needs to communicate with the Kong Admin API.

func (*FakeAdminAPIServer) MockNextResponse

func (f *FakeAdminAPIServer) MockNextResponse(r AdminAPIResponse)

Jump to

Keyboard shortcuts

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