events

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeInit            = EventType("Init")
	EventTypeRunMediaStart   = EventType("RunMediaStart")
	EventTypeRunMediaEnd     = EventType("RunMediaEnd")
	EventTypeFeedsDownloaded = EventType("FeedsDownloaded")
	EventTypeArticleOpened   = EventType("ArticleOpened")
	EventTypeLinkOpened      = EventType("LinkOpened")
)

Variables

This section is empty.

Functions

func Emit

func Emit(e Event)

func New

func New(L *lua.LState) lua.LValue

func Subscribe

func Subscribe(et EventType, c EventCallback)

Types

type ArticleOpened

type ArticleOpened struct {
	Link string
	Card func(*lua.LState) lua.LValue
}

func (*ArticleOpened) Type

func (e *ArticleOpened) Type() EventType

type Event

type Event interface {
	Type() EventType
}

type EventCallback

type EventCallback func(e Event) error

type EventCallbacks

type EventCallbacks map[EventType][]EventCallback

func (EventCallbacks) Emit

func (ec EventCallbacks) Emit(e Event)

func (EventCallbacks) Subscribe

func (ec EventCallbacks) Subscribe(et EventType, c EventCallback)

type EventType

type EventType string

type FeedsDownloaded

type FeedsDownloaded struct{}

func (*FeedsDownloaded) Type

func (e *FeedsDownloaded) Type() EventType

type Init

type Init struct{}

func (*Init) Type

func (e *Init) Type() EventType

type LinkOpened

type LinkOpened struct {
	Link string
	Card func(*lua.LState) lua.LValue
}

func (*LinkOpened) Type

func (e *LinkOpened) Type() EventType

type RunMediaEnd

type RunMediaEnd struct {
	Link string
	Card func(*lua.LState) lua.LValue
}

func (*RunMediaEnd) Type

func (e *RunMediaEnd) Type() EventType

type RunMediaStart

type RunMediaStart struct {
	Link string
	Card func(*lua.LState) lua.LValue
}

func (*RunMediaStart) Type

func (e *RunMediaStart) Type() EventType

Jump to

Keyboard shortcuts

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