app

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package app contains main mt-tgadmin functionality.

Package app contains main mt-tgadmin functionality.

Index

Constants

View Source
const DefaultSettingsFilename = ".bot.yml"

Variables

View Source
var BuildCommit = "DEV"
View Source
var BuildVersion = "DEV"
View Source
var Global struct {
	AppName   string
	Version   string
	Commit    string
	BuiltWith string

	SettingsFilename string   //filename
	Settings         Settings //settings object

	BotInfo  string
	ChatInfo string

	ServiceAutostart bool
}
View Source
var WebAssets *embed.FS
View Source
var WebIndexHtml *string

Functions

func BuildWebRouter

func BuildWebRouter() *mux.Router

func InitApi

func InitApi() bool

func NewApiRequest

func NewApiRequest(responseWriter *http.ResponseWriter, request *http.Request) (*apiRequest, error)

func WebApiRequestHandler

func WebApiRequestHandler(w http.ResponseWriter, r *http.Request)

func WebIndex

func WebIndex(w http.ResponseWriter, r *http.Request)

Types

type Settings

type Settings struct {
	BotToken  string `yaml:"bot_token" yaml_comment:"Bot authorization token"`
	BotChatID int64  `yaml:"bot_chat_id" yaml_comment:"'chat_id' int64 value"`

	GuiCookieSecretKey string `yaml:"gui_cookie_secret_key" yaml_comment:"At least 32 chars"`
	GuiPassword        string `yaml:"gui_password" yaml_comment:"GUI access password"`
	GuiHostname        string `yaml:"gui_hostname" yaml_comment:"Web GUI hostname"`
	GuiPort            uint16 `yaml:"gui_port" yaml_comment:"Web GUI port number"`

	ServiceName  string `yaml:"service_name" yaml_comment:"Service name for 'install' command"`
	ServiceUser  string `yaml:"service_user" yaml_comment:"User for 'install' command"`
	ServiceGroup string `yaml:"service_group" yaml_comment:"Group for 'install' command"`
}

Jump to

Keyboard shortcuts

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