pdk

package module
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 31

README

Build Status Latest release

Kong Plugin Development Kit - Go edition

Docs: https://pkg.go.dev/github.com/Kong/go-pdk.

Documentation

Overview

Package Kong/go-pdk implements Kong's Plugin Development Kit for Go.

It directly parallels the existing kong PDK for Lua plugins.

Kong plugins written in Go implement event handlers as methods on the Plugin's structure, with the given signature:

func (conf *MyConfig) Access (kong *pdk.PDK) {
	...
}

The `kong` argument of type `*pdk.PDK` is the entrypoint for all PDK functions. For example, to get the client's IP address, you'd use `kong.Client.GetIp()`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PDK

type PDK struct {
	Client          client.Client
	Ctx             ctx.Ctx
	Log             log.Log
	Nginx           nginx.Nginx
	Request         request.Request
	Response        response.Response
	Router          router.Router
	IP              ip.Ip
	Node            node.Node
	Service         service.Service
	ServiceRequest  service_request.Request
	ServiceResponse service_response.Response
}

PDK go pdk module

func Init

func Init(conn net.Conn) *PDK

Init initialize go pdk. Called by the pluginserver at initialization.

Directories

Path Synopsis
Used internally for the RPC protocol.
Used internally for the RPC protocol.
Client information module.
Client information module.
Current request context data.
Current request context data.
Some struct definitons for Kong entities.
Some struct definitons for Kong entities.
Trusted IPs module.
Trusted IPs module.
Write to log file.
Write to log file.
Access Nginx APIs.
Access Nginx APIs.
Node-level utilities
Node-level utilities
Client request module.
Client request module.
Client response module.
Client response module.
Router module.
Router module.
Service module.
Service module.
request
Manipulation of the request to the Service.
Manipulation of the request to the Service.
response
Manipulation of the response from the Service.
Manipulation of the response from the Service.
Utilities to test plugins.
Utilities to test plugins.

Jump to

Keyboard shortcuts

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