go-pdk: github.com/Kong/go-pdk Index | Files | Directories

package pdk

import "github.com/Kong/go-pdk"

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

Package Files

pdk.go

type PDK Uses

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 Uses

func Init(ch chan interface{}) *PDK

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

Directories

PathSynopsis
bridgeUsed internally for the RPC protocol.
clientClient information module.
ctxCurrent request context data.
entitiesSome struct definitons for Kong entities.
ipTrusted IPs module.
logWrite to log file.
nginxAccess Nginx APIs.
nodeNode-level utilities
requestClient request module.
responseClient response module.
routerRouter module.
serviceService module.
service/requestManipulation of the request to the Service.
service/responseManipulation of the response from the Service.

Package pdk imports 12 packages (graph). Updated 2020-05-27. Refresh now. Tools for package owners.