Documentation ¶
Overview ¶
Package app contains main mt-tgadmin functionality.
Package app contains main mt-tgadmin functionality.
Index ¶
- Constants
- Variables
- func BuildWebRouter() *mux.Router
- func InitApi() bool
- func NewApiRequest(responseWriter *http.ResponseWriter, request *http.Request) (*apiRequest, error)
- func PrepareTelegramHtml(input string) (r string)
- func WebApiRequestHandler(w http.ResponseWriter, r *http.Request)
- func WebIndex(w http.ResponseWriter, r *http.Request)
- type Settings
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 NewApiRequest ¶
func NewApiRequest(responseWriter *http.ResponseWriter, request *http.Request) (*apiRequest, error)
func PrepareTelegramHtml ¶
func WebApiRequestHandler ¶
func WebApiRequestHandler(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"` }
Click to show internal directories.
Click to hide internal directories.