app

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadersSSE

func HeadersSSE(c *router.Context)

Types

type App

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

func New

func New(ctx *types.VertexContext) *App

func (*App) Context

func (app *App) Context() *Context

func (*App) Description

func (app *App) Description() string

func (*App) ID

func (app *App) ID() string

func (*App) Meta

func (app *App) Meta() Meta

func (*App) Name

func (app *App) Name() string

func (*App) Register

func (app *App) Register(meta Meta)

func (*App) RegisterRouter

func (app *App) RegisterRouter(route string, router Router)

func (*App) Routers

func (app *App) Routers() map[string]Router

type AppRegistry

type AppRegistry struct {
	Interface
	*App
}

type AppsRegistry

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

func NewAppsRegistry

func NewAppsRegistry(ctx *types.VertexContext) *AppsRegistry

func (*AppsRegistry) Apps

func (registry *AppsRegistry) Apps() map[string]AppRegistry

func (*AppsRegistry) Close

func (registry *AppsRegistry) Close()

func (*AppsRegistry) RegisterApp

func (registry *AppsRegistry) RegisterApp(app *App, impl Interface) error

type Context

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

func NewContext

func NewContext(vertexCtx *types.VertexContext) *Context

func (*Context) AddListener

func (ctx *Context) AddListener(listener types.Listener)

func (*Context) DispatchEvent

func (ctx *Context) DispatchEvent(event interface{})

func (*Context) RemoveListener

func (ctx *Context) RemoveListener(listener types.Listener)

type Interface

type Interface interface {
	Initialize(app *App) error
}

type Meta

type Meta struct {
	// ID is the unique identifier of the app.
	ID string `json:"id"`

	// Name is the name of the app visible to the user.
	Name string `json:"name"`

	// Description is a brief description of the app.
	Description string `json:"description"`

	// Icon is the material symbol name for the app.
	Icon string `json:"icon"`
}

type Router

type Router interface {
	AddRoutes(r *router.Group)
}

type Service

type Service interface {
	OnEvent(e interface{})
}

type Uninitializable

type Uninitializable interface {
	Uninitialize() error
}

Jump to

Keyboard shortcuts

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