app

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizedChats

type AuthorizedChats interface {
	AuthorizedChatIDs() map[telegram.ID]bool
}

type AuthorizedUsers

type AuthorizedUsers interface {
	AuthorizedUserIDs() map[telegram.ID]bool
}

type Extension

type Extension interface {
	ID() string
	Apply(ctx context.Context, app Interface, buttons *core.ControlButtons) (interface{}, error)
}

type Instance

type Instance struct {
	*app.Base
	// contains filtered or unexported fields
}

func Create

func Create(version string, clock flu.Clock, config flu.File) (*Instance, error)

func (*Instance) ApplyExtensions

func (app *Instance) ApplyExtensions(extensions ...Extension)

func (*Instance) GetBot

func (app *Instance) GetBot(ctx context.Context) (*telegram.Bot, error)

func (*Instance) GetControlButtons

func (app *Instance) GetControlButtons() *core.ControlButtons

func (*Instance) GetDatabase

func (app *Instance) GetDatabase(conn string) (*gorm.DB, error)

func (*Instance) Run

func (app *Instance) Run(ctx context.Context) error

type Interface

type Interface interface {
	flu.Clock
	GetConfig(value interface{}) error
	GetMetricsRegistry(ctx context.Context) (metrics.Registry, error)
	GetDatabase(conn string) (*gorm.DB, error)
	GetBot(ctx context.Context) (*telegram.Bot, error)
	Manage(service io.Closer)
}

Jump to

Keyboard shortcuts

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