plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

Plugins schema from Kong

Plugins not included:

  • oauth2

Plugins included with changes:

  • Pre-function: schema copied from _schema.lua
  • Post-function: schema copied from _schema.lua
  • acme: removed check for shared_dict
  • http-log: use patched.url instead of socket.url

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchemaNotFound = fmt.Errorf("not found")
View Source
var Schemas embed.FS

Functions

This section is empty.

Types

type Validator

type Validator interface {
	// Validate executes the validate() Lua function for the given plugin.
	Validate(ctx context.Context, plugin *model.Plugin) error

	// ValidateSchema executes the ValidateSchema() Lua function for the given plugin schema
	// and returns the plugin name. In the event the schema is not valid or the plugin name
	// already exists (e.g. bundled plugin), an error is returned.
	ValidateSchema(ctx context.Context, pluginSchema string) (string, error)

	// ProcessDefaults executes the process_auto_fields() Lua function for the given plugin.
	ProcessDefaults(ctx context.Context, plugin *model.Plugin) error

	// GetAvailablePluginNames returns all available plugins, in
	// ascending order. The returned slice must not be modified.
	GetAvailablePluginNames(ctx context.Context) []string

	// GetRawLuaSchema returns the raw Lua schema for the given plugin (bundled or non-bundled). In the
	// event the plugin does not exist, an error is returned. The returned slice must not be modified.
	GetRawLuaSchema(ctx context.Context, name string) ([]byte, error)
}

Validator handles various needs for plugin validation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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