core

package
v0.0.0-...-52192e4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const SCRIPT_DIR = "./scripts/"

Variables

This section is empty.

Functions

func NewResult

func NewResult(code int, r interface{}) lua.LString

func Splite

func Splite(str lua.LString) []string

Types

type Activity

type Activity struct {
	L        *lua.LState
	Father   string
	Pass     string
	Name     string
	Types    string
	NeedArgs string
	Groups   string
	Handler  lua.LValue
}

func FindActivityByName

func FindActivityByName(l *lua.LState, name string) *Activity

func (*Activity) Handle

func (activity *Activity) Handle(param string) (string, error)

type CoreIoBus

type CoreIoBus interface {
	RequestHandler(ReponseWriter, *Request) error
	RawLuaHandler(string) string
	GetMapper() map[string]string
	ReloadConfig() string
	GetActivities([]byte, string) (string, error)
	ListNeedArgs([]byte, string) ([]string, error)
	GetPurviewActivities(string) ([]string, error)
}

type DataBase

type DataBase interface {
	AddRow(...map[string]string) error
	DeleteRow(...string) error
	FindRow(string, ...string) (string, error)
	ModifyRow(...map[string]string) error
	GetJustDone(string) (string, string, error)
	GetList(string, string) (string, error)
}

type HandleErr

type HandleErr struct {
	When time.Time
	What string
}

func (HandleErr) Error

func (e HandleErr) Error() string

type Purview

type Purview interface {
	Verify(req []byte, target string) bool
	GetGroupsOfUser(auth string) *[]string
}

type ReponseWriter

type ReponseWriter interface {
	Write([]byte) (int, error)
}

type Request

type Request struct {
	Name string
	Id   string
	Type string
	Args string
	Auth []byte
}

type Response

type Response struct {
	Status int
	Body   string
}

func (*Response) Write

func (this *Response) Write(b []byte) (int, error)

type VM

type VM struct {
	lua.LState
}

type VMs

type VMs struct {
	Scripts    string
	Activities map[string]string
	Mappler    map[string]string
	Api        map[string]func(*lua.LState) int
	Db         DataBase
	Auth       Purview
	Re         *regexp.Regexp
}

func InitCore

func InitCore() *VMs

func (VMs) AddRowFunc

func (this VMs) AddRowFunc(l *lua.LState) int

func (VMs) DelRowFunc

func (this VMs) DelRowFunc(l *lua.LState) int

func (VMs) FindRowFunc

func (this VMs) FindRowFunc(l *lua.LState) int

func (*VMs) GetActivities

func (this *VMs) GetActivities(auth []byte, action string) (string, error)

func (*VMs) GetMapper

func (this *VMs) GetMapper() map[string]string

func (*VMs) GetPurviewActivities

func (this *VMs) GetPurviewActivities(auth string) ([]string, error)

func (VMs) InitDatabase

func (this VMs) InitDatabase(l *lua.LState, a *Activity)

func (*VMs) InitMap

func (this *VMs) InitMap()

func (*VMs) ListNeedArgs

func (this *VMs) ListNeedArgs(auth []byte, action string) ([]string, error)

func (VMs) ModRowFunc

func (this VMs) ModRowFunc(l *lua.LState) int

func (*VMs) RawLuaHandler

func (this *VMs) RawLuaHandler(str string) string

func (*VMs) RegeditApi

func (this *VMs) RegeditApi(list map[string]func(*lua.LState) int)

func (*VMs) ReloadConfig

func (this *VMs) ReloadConfig() string

func (*VMs) RequestHandler

func (this *VMs) RequestHandler(w ReponseWriter, r *Request) error

func (*VMs) SetAuther

func (this *VMs) SetAuther(p Purview)

func (*VMs) SetDataBase

func (this *VMs) SetDataBase(database DataBase)

Jump to

Keyboard shortcuts

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