testing_framework

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

README

Way to test plugin.

Golang

	state := lua.NewState()
	testing_framework.Preload(state)
	testing_framework.New(state, "./root_of_plugins/", "plugin_name",
		"host", "gatherer-db-test", 5432, "gatherer-user-test", "gatherer-password")

Lua

plugin:create()

Start "plugin.lua" in background, raise error if plugin already created.

plugin:remove()

Stop "plugin.lua" (raise error 'context canceled' in plugin), raise error if plugin was removed.

plugin:restart_count()

Get restart count of plugin, raise error if plugin was removed.

plugin:error_count()

Get restart with error count of plugin, raise error if plugin was removed.

plugin:last_error()

Get string with error text, raise error if plugin was removed.

connection:query()

Execute read-only query in manager-db with args. Return table with rows and columns, raise error.

local result = connection:query("select $1::integer, $1::text, $2", 1, "tests")
--[[
result:
  {
    columns = { "int4", "text", "?column?" },
    rows = { { 1, "1", "1" } }
  }
--]]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(L *lua.LState, rootDir, cacheDir, pluginName, host, dbname, user, password string, port int, params map[string]string) error

New create new testing_framework into lua state as user data

func Preload

func Preload(L *lua.LState) int

Preload is the preloader of user data connection_ud.

Types

This section is empty.

Jump to

Keyboard shortcuts

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