apps

package
v0.0.0-...-3f9d7ef Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

type AppConstructor

type AppConstructor func(
	messages.LoadApp,
	IAppManager,
) IApp

AppConstructor represents a function that can be used to create an App instance

type IApp

type IApp interface {
	GetName() string
	GetSessionUUID() uuid.UUID
	OnInput(pmessages.Input)
	Start()
	Stop()
}

IApp implement this interface for apps.

func WelcomeApp

func WelcomeApp(message messages.LoadApp, appManager IAppManager) IApp

WelcomeApp creates a new WelcomeApp instance

type IAppManager

type IAppManager interface {
	// Core Methods
	CreateLogger(IApp) *logrus.Entry
	Engine() engine.Engine
	SetRegisteredApps(map[string]AppConstructor)

	// Lifecycle methods
	Start()
	Stop()

	// Rendering
	PutsToSession(IApp, string)
	RenderStringToSession(IApp, string) error
	RenderTemplateToSession(IApp, string) error

	// App store
	GetFromAppStore(IApp, string, interface{}) error
	SetInAppStore(IApp, string, interface{}) error
}

IAppManager handles management of apps that are used by sessions for interactions

func NewManager

NewManager creates a new app manager instance

type Status

type Status struct {
	Started bool
}

Status represents the current application status

type Welcome

type Welcome struct {
	*App
}

Welcome the welcome app is the first app loaded when a session connects

func (*Welcome) GetName

func (w *Welcome) GetName() string

GetName returns the app name

func (*Welcome) GetSessionUUID

func (w *Welcome) GetSessionUUID() uuid.UUID

GetSessionUUID returns the session uuid

func (*Welcome) OnInput

func (w *Welcome) OnInput(input pmessages.Input)

OnInput handles input events

func (*Welcome) Start

func (w *Welcome) Start()

Start starts the app

func (*Welcome) Stop

func (w *Welcome) Stop()

Stop stops the app

Jump to

Keyboard shortcuts

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