node

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Overview

Node-level utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStats

type MemoryStats struct {
	LuaSharedDicts struct {
		Kong struct {
			AllocatedSlabs int `json:"allocated_slabs"`
			Capacity       int `json:"capacity"`
		} `json:"kong"`
		KongDbCache struct {
			AllocatedSlabs int `json:"allocated_slabs"`
			Capacity       int `json:"capacity"`
		} `json:"kong_db_cache"`
	} `json:"lua_shared_dicts"`
	WorkersLuaVms []struct {
		HttpAllocatedGc int `json:"http_allocated_gc"`
		Pid             int `json:"pid"`
	} `json:"workers_lua_vms"`
}

type Node

type Node struct {
	bridge.PdkBridge
}

Holds this module's functions. Accessible as `kong.Node`

func New

func New(ch chan interface{}) Node

Called by the plugin server at initialization.

func (Node) GetCtxSharedAny added in v0.3.1

func (n Node) GetCtxSharedAny(k string) (interface{}, error)

kong.Node.GetCtxSharedAny() returns a value from the `kong.ctx.shared` request context table.

func (Node) GetCtxSharedFloat added in v0.3.1

func (n Node) GetCtxSharedFloat(k string) (float64, error)

kong.Node.GetCtxSharedFloat() returns a float value from the `kong.ctx.shared` request context table.

func (Node) GetCtxSharedString added in v0.3.1

func (n Node) GetCtxSharedString(k string) (string, error)

kong.Node.GetCtxSharedString() returns a string value from the `kong.ctx.shared` request context table.

func (Node) GetId

func (n Node) GetId() (string, error)

kong.Node.GetId() returns the v4 UUID used by this node to describe itself.

func (Node) GetMemoryStats

func (n Node) GetMemoryStats() (ms MemoryStats, err error)

kong.Node.GetMemoryStats() returns memory usage statistics about this node.

func (Node) SetCtxShared added in v0.3.1

func (n Node) SetCtxShared(k string, value interface{}) error

kong.Node.SetCtxShared() sets a value in the `kong.ctx.shared` request context table.

Jump to

Keyboard shortcuts

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