Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotCmd ¶
type BotCmd struct { Reporter `group:"reporter" namespace:"reporter" env-namespace:"REPORTER"` Token string `long:"token" env:"TOKEN" description:"Bot token" required:"true"` DB string `long:"db" env:"DB" description:"Database filepath" required:"true" default:"bbolt.db"` CommonOpts Admins []string `short:"a" long:"admin" env:"ADMIN" env-delim:"," description:"Bot admin telegram usernames" required:"true"` Pattern string `long:"pattern" env:"PATTERN" description:"Bot server handler pattern" default:"/"` CertFile flags.Filename `long:"cert" env:"CERT_FILE" description:"Bot server tls cert file"` KeyFile flags.Filename `long:"key" env:"KEY_FILE" description:"Bot server tls key file"` WebhookURL string `long:"webhook_url" env:"WEBHOOK_URL" description:"Bot server webhook url"` Address string `long:"address" env:"ADDRESS" description:"Bot server bind address" default:"0.0.0.0:443"` Hub `group:"hub" namespace:"hub" env-namespace:"HUB"` }
type CommonOptionsCommander ¶
type CommonOptionsCommander interface { SetCommon(commonOpts CommonOpts) Execute(args []string) error }
CommonOptionsCommander extends flags.Commander with SetCommon All commands should implement this interfaces
type CommonOpts ¶
CommonOpts sets externally from main, shared across all commands
func (*CommonOpts) SetCommon ¶
func (opts *CommonOpts) SetCommon(commonOpts CommonOpts)
SetCommon satisfies CommonOptionsCommander interface and sets common option fields The method called by main for each command
type Hub ¶
type Hub struct { AppHash string `long:"app_hash" env:"APP_HASH" description:"Telegram API app hash" required:"true"` PublicKey flags.Filename `long:"pk" env:"PUBLIC_KEY" description:"Telegram API public key" required:"true"` DeviceModel string `long:"device" env:"DEVICE" description:"Telegram API device model" default:"Dmitry Nev"` DCOption struct { IPAddress string `long:"ip" env:"IP" description:"DC ip address" required:"true"` ID int `long:"id" env:"ID" description:"DC id" default:"2"` Port int `long:"port" env:"PORT" description:"DC port" default:"443"` } `group:"dc" namespace:"dc" env-namespace:"DC"` ClientTTL time.Duration `long:"client_ttl" env:"CLIENT_TTL" description:"A telegram API client TTL" default:"3m"` AppID int `long:"app_id" env:"APP_ID" description:"Telegram API app id" required:"true"` }
type MergeCmd ¶
type MergeCmd struct { Current flags.Filename `long:"current" env:"CURRENT" description:"Current database filepath" required:"true" default:"current.db"` Target flags.Filename `long:"target" env:"TARGET" description:"Target database filepath" required:"true" default:"target.db"` CommonOpts }
type Reporter ¶
type Reporter struct { Message string `` // nolint /* 262-byte string literal not displayed */ Interval time.Duration `long:"interval" env:"INTERVAL" description:"Interval between sending reports" default:"40m"` IntervalMaxReports int `long:"max_reps" env:"INTERVAL_MAX_REPORTS" default:"25" description:"Max number of sent reports from a telegram client"` // nolint }
Click to show internal directories.
Click to hide internal directories.