Documentation
¶
Index ¶
- Constants
- Variables
- func LoadAppManifest(b bundle.Bundle) (*repository.AppManifest, error)
- func ServiceProvider() service.Provider
- type Backend
- func (b *Backend) Exec(callable goja.Callable, args ...interface{}) (goja.Value, error)
- func (b *Backend) ExecFuncByName(funcName string, args ...interface{}) (goja.Value, error)
- func (b *Backend) IsPromise(v goja.Value) (*goja.Promise, bool)
- func (b *Backend) Load(src string) error
- func (b *Backend) NewPromise() *PromiseProxy
- func (b *Backend) OnInit() error
- func (b *Backend) OnUserConnect(id repository.UserID) error
- func (b *Backend) OnUserDisconnect(id repository.UserID) error
- func (b *Backend) OnUserMessage(id repository.UserID, data interface{}) error
- func (b *Backend) Start()
- func (b *Backend) Stop()
- func (b *Backend) ToValue(v interface{}) goja.Value
- func (b *Backend) WaitForPromise(promise *goja.Promise) goja.Value
- type BackendModule
- type BackendModuleFactory
- type FilesystemLoader
- type LoadedApp
- type Manager
- type PromiseProxy
Constants ¶
View Source
const (
ServiceName service.Name = "app"
)
Variables ¶
View Source
var ( ErrBundleNotFound = errors.New("bundle not found") ErrNoBackend = errors.New("no backend") )
View Source
var ErrFuncDoesNotExist = errors.New("function does not exist")
View Source
var ErrUnknownBundleArchiveFormat = errors.New("unknown bundle archive format")
Functions ¶
func LoadAppManifest ¶
func LoadAppManifest(b bundle.Bundle) (*repository.AppManifest, error)
func ServiceProvider ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func NewBackend ¶
func NewBackend(appID repository.AppID, modules ...BackendModuleFactory) *Backend
func (*Backend) ExecFuncByName ¶
func (*Backend) NewPromise ¶
func (b *Backend) NewPromise() *PromiseProxy
func (*Backend) OnUserConnect ¶
func (b *Backend) OnUserConnect(id repository.UserID) error
func (*Backend) OnUserDisconnect ¶
func (b *Backend) OnUserDisconnect(id repository.UserID) error
func (*Backend) OnUserMessage ¶
func (b *Backend) OnUserMessage(id repository.UserID, data interface{}) error
type BackendModule ¶
type BackendModuleFactory ¶
type BackendModuleFactory func(repository.AppID, *Backend) BackendModule
type FilesystemLoader ¶
type FilesystemLoader struct {
// contains filtered or unexported fields
}
func NewFilesystemLoader ¶
func NewFilesystemLoader(searchPatterns ...string) *FilesystemLoader
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) GetBackend ¶
func (m *Manager) GetBackend(id repository.AppID, modules ...BackendModuleFactory) (*Backend, error)
type PromiseProxy ¶
func NewPromiseProxy ¶
func NewPromiseProxy(promise *goja.Promise, resolve func(result interface{}), reject func(reason interface{})) *PromiseProxy
func (*PromiseProxy) Reject ¶
func (p *PromiseProxy) Reject(reason interface{})
func (*PromiseProxy) Resolve ¶
func (p *PromiseProxy) Resolve(result interface{})
func (*PromiseProxy) Wait ¶
func (p *PromiseProxy) Wait()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.