lualib

package
v0.0.0-...-d726a1a Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoToLua

func GoToLua(L *lua.LState, v interface{}) lua.LValue

func LNewChannel

func LNewChannel(g *G, ch slack.ChannelID) lua.LValue

func LNewResponse

func LNewResponse(L *lua.LState, resp *http.Response) *lua.LUserData

func LNewTeam

func LNewTeam(g *G) lua.LValue

func LNewUser

func LNewUser(g *G, user slack.UserID, preload bool) (lua.LValue, error)

func OpenBit

func OpenBit(L *lua.LState) int

func OpenBot

func OpenBot(team marvin.Team) func(L *lua.LState) int

func OpenCorpus

func OpenCorpus(L *lua.LState) int

func OpenFuncs

func OpenFuncs(L *lua.LState) int

func OpenGoogle

func OpenGoogle(g *G, L *lua.LState) int

func OpenIntra

func OpenIntra(g *G, L *lua.LState) int

func OpenJson

func OpenJson(L *lua.LState) int

func OpenRequests

func OpenRequests(L *lua.LState) int

func OpenTime

func OpenTime(L *lua.LState) int

The time module provides access to time formatting functions from Lua.

Module: time.rfc3339 -> string: formatting constant time.now() -> Time: returns the current time time.fromunix(sec, nsec=0) -> Time: creates a new Time from a unix timestamp time.parse(value, format=time.rfc3339) -> Time, err: Parses a time with the given format

Type: Time

t.year -> number: year number
t.month -> number
t.day -> number
t.hour -> number
t.minute -> number
t.second -> number
t.ns -> number: nanoseconds into the second
t.tz -> string: tzinfo-based timezone string (e.g. Europe/Paris)
t.__is_a_time -> bool: type indicator
t:format(str) -> string: formats a time according to https://godoc.org/time#pkg-constants
t:unix() -> number, number: returns the unix time (seconds, nanoseconds)

Types

type CorpusData

type CorpusData struct {
	Description string
	Field       string
	Source      string
	Content     []string
}

type G

type G struct {
	L        *lua.LState
	Ctx      context.Context
	PrintBuf bytes.Buffer
	// contains filtered or unexported fields
}

func NewLua

func NewLua(ctx context.Context, team marvin.Team, actionSource marvin.ActionSource) *G

func (*G) ActionSource

func (g *G) ActionSource() marvin.ActionSource

func (*G) OpenLibraries

func (g *G) OpenLibraries()

func (*G) Team

func (g *G) Team() marvin.Team

type LChannel

type LChannel struct {
	ID       slack.ChannelID
	IsPublic bool
	IsGroup  bool
	IsIM     bool
	IMOther  lua.LValue
	Info     *slack.Channel
	Creator  lua.LValue
	Users    *lua.LTable
	// contains filtered or unexported fields
}

LChannel ...

ch.id: slack.ChannelID
ch.type: "public", "group", "mpim", or "im"
ch.name: string
ch.creator: LUser
ch.im_other: slack.UserID
ch.users: []slack.UserID
ch.topic: string
ch.topic_user: LUser
ch.topic_changed: unixMillis
ch.purpose: string
ch.purpose_user: LUser
ch.purpose_changed: unixMillis

func (*LChannel) SetupMetatable

func (*LChannel) SetupMetatable(L *lua.LState) int

type LChannelIndex

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

type LUser

type LUser struct {
	ID   slack.UserID
	Acc  marvin.AccessLevel
	Info *slack.User
	// contains filtered or unexported fields
}

LUser has the following API:

tostring(user) -> "<@USLACKBOT>"
user.id -> "USLACKBOT"
user.is_blacklisted
user.is_admin
user.is_controller
user.username -> "slackbot"
 fname, lname, name
user.tz -> "America/Los_Angeles"
user.tz_offset -> -28800 (seconds)
user.profile.real
user.profile.first
user.profile.last
user.profile.phone

func (*LUser) SetupMetatable

func (*LUser) SetupMetatable(L *lua.LState)

type LUserIndex

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

Jump to

Keyboard shortcuts

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