lua

package module
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

krakend-lua

a lua interpreter for the KrakenD framework

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoExtraConfig    = errors.New("no extra config")
	ErrWrongExtraConfig = errors.New("wrong extra config")
)

Functions

func MapNativeTable added in v2.3.0

func MapNativeTable(t *NativeTable) (interface{}, bool)

func ParseToTable added in v2.3.0

func ParseToTable(k, v NativeValue, acc map[string]interface{})

func ToError

func ToError(e error, source *SourceMap) error

Types

type Binder added in v2.3.0

type Binder = binder.Binder

type BinderWrapper added in v2.2.0

type BinderWrapper struct {
	// contains filtered or unexported fields
}

func NewBinderWrapper added in v2.2.0

func NewBinderWrapper(binderOptions binder.Options) BinderWrapper

func (BinderWrapper) GetBinder added in v2.2.0

func (b BinderWrapper) GetBinder() *binder.Binder

func (BinderWrapper) WithCode added in v2.2.0

func (b BinderWrapper) WithCode(key string, src string) error

func (BinderWrapper) WithConfig added in v2.2.0

func (b BinderWrapper) WithConfig(cfg *Config) error

type Config

type Config struct {
	Sources       []string
	PreCode       string
	PostCode      string
	SkipNext      bool
	AllowOpenLibs bool
	SourceLoader  SourceLoader
}

func Parse

func Parse(l logging.Logger, e config.ExtraConfig, namespace string) (Config, error)

func (*Config) Get

func (c *Config) Get(k string) (string, bool)

type Context added in v2.3.0

type Context = binder.Context

type ErrInternal

type ErrInternal string

func (ErrInternal) Error

func (e ErrInternal) Error() string

type ErrInternalHTTP

type ErrInternalHTTP struct {
	// contains filtered or unexported fields
}

func (ErrInternalHTTP) Error

func (e ErrInternalHTTP) Error() string

func (ErrInternalHTTP) StatusCode

func (e ErrInternalHTTP) StatusCode() int

type ErrInternalHTTPWithContentType added in v2.2.0

type ErrInternalHTTPWithContentType struct {
	ErrInternalHTTP
	// contains filtered or unexported fields
}

func (ErrInternalHTTPWithContentType) Encoding added in v2.2.0

type ErrUnknownSource

type ErrUnknownSource string

func (ErrUnknownSource) Error

func (e ErrUnknownSource) Error() string

type ErrWrongChecksum

type ErrWrongChecksum struct {
	Source, Actual, Expected string
}

func (ErrWrongChecksum) Error

func (e ErrWrongChecksum) Error() string

type ErrWrongChecksumType

type ErrWrongChecksumType string

func (ErrWrongChecksumType) Error

func (e ErrWrongChecksumType) Error() string

type Handler added in v2.3.0

type Handler = binder.Handler

type List added in v2.3.0

type List struct {
	Data []interface{}
}

type NativeBool added in v2.3.0

type NativeBool = glua.LBool

type NativeNumber added in v2.3.0

type NativeNumber = glua.LNumber

type NativeString added in v2.3.0

type NativeString = glua.LString

type NativeTable added in v2.3.0

type NativeTable = glua.LTable

type NativeUserData added in v2.3.0

type NativeUserData = glua.LUserData

type NativeValue added in v2.3.0

type NativeValue = glua.LValue

type SourceLoader

type SourceLoader interface {
	Get(string) (string, bool)
}

type SourceMap added in v2.2.0

type SourceMap []struct {
	Lines int
	Path  string
}

func NewSourceMap added in v2.2.0

func NewSourceMap() SourceMap

func (*SourceMap) AffectedSource added in v2.2.0

func (s *SourceMap) AffectedSource(line int) (string, int, error)

func (*SourceMap) Append added in v2.2.0

func (s *SourceMap) Append(path string, src string) *SourceMap

type Table added in v2.3.0

type Table struct {
	Data map[string]interface{}
}

Directories

Path Synopsis
gin
mux

Jump to

Keyboard shortcuts

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