Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRateLimiter(perSec int, burst int) throttled.RateLimiter
- func FilterAll[T interface{}](T) bool
- type APIServer
- type ChannelClient
- type Delorean
- type FilterFunc
- type MapData
- type MapGenerator
- type Message
- type Persistence
- type PollResponse
- type Record
- type SSEEncoder
- type Settings
- type ShortState
- type State
- type StateResponse
- type StatesResponse
- type StatesShortResponse
- type TCPServer
- type Topic
- type Update
- type Updater
- type UpdaterState
Constants ¶
View Source
const MapHeight = 670
View Source
const MapWidth = 1000
View Source
const URLPattern = "https://t.me/s/%s"
Variables ¶
View Source
var AuthorSel = cascadia.MustCompile(".tgme_widget_message_author span")
View Source
var DateSel = cascadia.MustCompile(".tgme_widget_message_footer time[datetime]")
View Source
var MessagesSel = cascadia.MustCompile(".tgme_widget_message")
View Source
var TextSel = cascadia.MustCompile(".tgme_widget_message_text")
Functions ¶
func CreateRateLimiter ¶
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
func NewAPIServer ¶
type ChannelClient ¶
type ChannelClient struct {
// contains filtered or unexported fields
}
func NewChannelClient ¶
func NewChannelClient(channel string) *ChannelClient
func (*ChannelClient) FetchMessages ¶
func (*ChannelClient) FetchNewer ¶
type Delorean ¶
type Delorean struct {
// contains filtered or unexported fields
}
func (*Delorean) ListRecords ¶
type FilterFunc ¶
type FilterFunc[T interface{}] func(T) bool
type MapGenerator ¶
type MapGenerator struct { MapData *MapData // contains filtered or unexported fields }
func NewMapGenerator ¶
func NewMapGenerator(updaterState *UpdaterState, updates *Topic[Update]) *MapGenerator
func (*MapGenerator) GenerateMap ¶
func (g *MapGenerator) GenerateMap(updaterState *UpdaterState, title string, transparent bool) error
type Persistence ¶
type Persistence[T interface{}] struct { Data T // contains filtered or unexported fields }
func NewPersistence ¶
func NewPersistence[T interface{}](data T, path string) (*Persistence[T], error)
func (*Persistence[T]) Load ¶
func (p *Persistence[T]) Load() error
func (*Persistence[T]) Save ¶
func (p *Persistence[T]) Save() error
type PollResponse ¶
type SSEEncoder ¶
type SSEEncoder struct {
// contains filtered or unexported fields
}
func NewSSEEncoder ¶
func NewSSEEncoder(w http.ResponseWriter) *SSEEncoder
func (*SSEEncoder) Write ¶
func (e *SSEEncoder) Write(event string, data interface{}) error
type Settings ¶
type Settings struct { TelegramChannel string `env:"TELEGRAM_CHANNEL" envDefault:"air_alert_ua" yaml:"telegram_channel"` TimezoneName string `env:"TZ" envDefault:"Europe/Kiev" yaml:"timezone_name"` Timezone *time.Location `` APIKeys []string `env:"API_KEYS" envSeparator:"," envDefault:"" yaml:"api_keys"` Debug bool `env:"DEBUG" envDefault:"false" yaml:"debug"` Trace bool `env:"TRACE" envDefault:"false" yaml:"trace"` BacklogSize int `env:"BACKLOG_SIZE" envDefault:"200" yaml:"backlog_size"` }
func MustLoadSettings ¶
func MustLoadSettings() (settings Settings)
type ShortState ¶
type StateResponse ¶
type StatesResponse ¶
type StatesShortResponse ¶
type StatesShortResponse struct { States []ShortState `json:"states"` LastUpdate time.Time `json:"last_update"` }
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
func NewTCPServer ¶
type Topic ¶
type Topic[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Topic[T]) Unsubscribe ¶
func (t *Topic[T]) Unsubscribe(ch chan T)
Click to show internal directories.
Click to hide internal directories.