Documentation
¶
Index ¶
- Constants
- func DefaultPlugins() []akevitt.Plugin
- func LoginScreen(engine *akevitt.Akevitt, session *akevitt.ActiveSession, ...) tview.Primitive
- func NewHelpPlugin() *helpPluginBuilder
- func RegistrationScreen(engine *akevitt.Akevitt, session *akevitt.ActiveSession, ...) tview.Primitive
- type AccountPlugin
- type BoltDbPlugin
- type Dialogue
- func (dial *Dialogue) AddOption(title string, content tview.Primitive) *Dialogue
- func (dial *Dialogue) End(text string) *Dialogue
- func (dial *Dialogue) GetContents() tview.Primitive
- func (dial *Dialogue) GetOptions() []*Dialogue
- func (dial *Dialogue) GetTitle() string
- func (dial *Dialogue) Proceed(index int, session *akevitt.ActiveSession, plugin *DialoguePlugin) error
- func (dial *Dialogue) SetContent(content tview.Primitive) *Dialogue
- type DialogueFunc
- type DialoguePlugin
- type Doc
- type HeartBeatsPlugin
- type HeartBuilder
- type HeartbeatMap
- type HelpPlugin
- type MessageFunc
- type MessagePlugin
- func (plugin *MessagePlugin) AddChannel(channel string, session *akevitt.ActiveSession)
- func (plugin *MessagePlugin) Build(engine *akevitt.Akevitt) error
- func (plugin *MessagePlugin) GetChatLog(session *akevitt.ActiveSession) *tview.TextView
- func (plugin *MessagePlugin) Message(engine *akevitt.Akevitt, channel, message, username string, ...) error
- func (plugin *MessagePlugin) RemoveChannel(channel string, session *akevitt.ActiveSession)
- func (plugin *MessagePlugin) UpdateChannel(old, new string, session *akevitt.ActiveSession)
Constants ¶
View Source
const MessagePluginData string = "MessagePlugin"
Variables ¶
This section is empty.
Functions ¶
func DefaultPlugins ¶
func LoginScreen ¶
func NewHelpPlugin ¶ added in v0.3.5
func NewHelpPlugin() *helpPluginBuilder
func RegistrationScreen ¶
Types ¶
type AccountPlugin ¶
type AccountPlugin struct {
// contains filtered or unexported fields
}
func NewAccountPlugin ¶
func NewAccountPlugin() *AccountPlugin
func (*AccountPlugin) LoginSession ¶
func (plugin *AccountPlugin) LoginSession(username, password string, session *akevitt.ActiveSession) error
func (*AccountPlugin) Register ¶
func (plugin *AccountPlugin) Register(username, password, repeatPassword string, session *akevitt.ActiveSession) error
type BoltDbPlugin ¶
func NewBoltPlugin ¶
func NewBoltPlugin[T akevitt.Object](path string) *BoltDbPlugin[T]
func (*BoltDbPlugin[T]) LoadAll ¶
func (plugin *BoltDbPlugin[T]) LoadAll() ([]T, error)
func (*BoltDbPlugin[T]) Save ¶
func (plugin *BoltDbPlugin[T]) Save(object T) error
type Dialogue ¶
type Dialogue struct {
// contains filtered or unexported fields
}
Dialogue struct for creating dialogue-like events. The content is actually a UI element, so you implement merchants, dialogues, etc. You must call NewDialogue to get started.
func (*Dialogue) GetContents ¶
Gets the UI of dialogue
func (*Dialogue) GetOptions ¶
Gets an array of options
func (*Dialogue) Proceed ¶
func (dial *Dialogue) Proceed(index int, session *akevitt.ActiveSession, plugin *DialoguePlugin) error
Invokes engine.Dialogue of the specified index from options.
type DialogueFunc ¶
type DialoguePlugin ¶
type DialoguePlugin struct {
// contains filtered or unexported fields
}
func NewDialoguePlugin ¶
func NewDialoguePlugin(fn DialogueFunc) *DialoguePlugin
func (*DialoguePlugin) Dialogue ¶
func (plugin *DialoguePlugin) Dialogue(dialogue *Dialogue, session *akevitt.ActiveSession) error
Invokes dialogue event. Make sure you have installed the hook during initalisation.
func (*DialoguePlugin) NewDialogue ¶
func (*DialoguePlugin) NewDialogue(title string) *Dialogue
Creates new instance of dialogue
type HeartBeatsPlugin ¶
type HeartBeatsPlugin struct {
// contains filtered or unexported fields
}
func (*HeartBeatsPlugin) Build ¶
func (plugin *HeartBeatsPlugin) Build(engine *akevitt.Akevitt) error
func (*HeartBeatsPlugin) SubscribeToHeartBeat ¶
func (plugin *HeartBeatsPlugin) SubscribeToHeartBeat(interval time.Duration, fn func() error) error
type HeartBuilder ¶
type HeartBuilder struct {
// contains filtered or unexported fields
}
func NewHeartbeatPlugin ¶
func NewHeartbeatPlugin() *HeartBuilder
func (*HeartBuilder) Finish ¶
func (builder *HeartBuilder) Finish() *HeartBeatsPlugin
func (*HeartBuilder) NewDuration ¶
func (builder *HeartBuilder) NewDuration(duration time.Duration) *HeartBuilder
type HeartbeatMap ¶
type HelpPlugin ¶ added in v0.3.5
type HelpPlugin struct {
// contains filtered or unexported fields
}
func (*HelpPlugin) Build ¶ added in v0.3.5
func (plugin *HelpPlugin) Build(engine *akevitt.Akevitt) error
func (*HelpPlugin) FindHelp ¶ added in v0.3.5
func (plugin *HelpPlugin) FindHelp(command string) (string, error)
func (*HelpPlugin) ListHelp ¶ added in v0.3.5
func (plugin *HelpPlugin) ListHelp() string
func (*HelpPlugin) ListHelpCustom ¶ added in v0.3.5
func (plugin *HelpPlugin) ListHelpCustom(callback func(string, Doc) string) string
type MessageFunc ¶
type MessagePlugin ¶
type MessagePlugin struct {
// contains filtered or unexported fields
}
func NewMessagePlugin ¶
func NewMessagePlugin(includeCmd bool, fn MessageFunc, format string) *MessagePlugin
func (*MessagePlugin) AddChannel ¶ added in v0.3.5
func (plugin *MessagePlugin) AddChannel(channel string, session *akevitt.ActiveSession)
func (*MessagePlugin) GetChatLog ¶
func (plugin *MessagePlugin) GetChatLog(session *akevitt.ActiveSession) *tview.TextView
func (*MessagePlugin) Message ¶
func (plugin *MessagePlugin) Message(engine *akevitt.Akevitt, channel, message, username string, session *akevitt.ActiveSession) error
Send the message to other current sessions
func (*MessagePlugin) RemoveChannel ¶ added in v0.3.5
func (plugin *MessagePlugin) RemoveChannel(channel string, session *akevitt.ActiveSession)
func (*MessagePlugin) UpdateChannel ¶
func (plugin *MessagePlugin) UpdateChannel(old, new string, session *akevitt.ActiveSession)
Click to show internal directories.
Click to hide internal directories.