v1

package
v1.5.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnableToOpenDatabaseConnection is returned when there is an error when opening a database connection.
	ErrUnableToOpenDatabaseConnection = errors.New("error when opening database connection")
	// ErrUnsupportedStorageType is returned when an unsupported storage type is used.
	ErrUnsupportedStorageType = errors.New("unsupported storage type")
	// ErrUnauthorizedToUseTelegramBotCommand is returned when the trying
	// to use the telegram bot command is not a superuser.
	ErrUnauthorizedToUseTelegramBotCommand = errors.New("unauthorized to use command")
	// ErrInsufficientArguments is returned when there are not enough arguments to use the command.
	ErrInsufficientArguments = errors.New("insufficient arguments")
)

Functions

func Run

func Run(parentCtx context.Context) error

Run starts the app in a separate goroutine and waits for it to stop. It initializes a logger and reads in a configuration file. It then creates a context with a cancel function, which is used to stop the app when the context is cancelled. The app is started in a separate goroutine, and the function waits for the context to be done before stopping the app and waiting for the goroutine to finish. If the app stopped with an error, that error is returned by the function.

parentCtx: the parent context to use for the app's context.

Returns an error if the app stopped with an error or if there was an error when initializing the config.

Types

This section is empty.

Jump to

Keyboard shortcuts

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