Documentation
¶
Index ¶
- Variables
- func AppRootDir() (string, error)
- func ApplyChatMigration(oldID, newID string)
- func Configure(logFilePath, logLevelStr string) error
- func CurrentTelegramBaseURL() string
- func CurrentVersion() string
- func Debug(format string, v ...interface{})
- func EnqueueTelegramAlert(message string)
- func Error(format string, v ...interface{})
- func EscapeMarkdownV2(text string) string
- func Fatal(format string, v ...interface{})
- func GetTelegramBotToken() string
- func GetTelegramChatID() string
- func GetTraceID(ctx context.Context) string
- func Info(format string, v ...interface{})
- func InitSentry(service string, overrides ...string)
- func IsClientGone(err error) bool
- func LocationFromRequest(r *http.Request) string
- func LocationMiddleware(clientIP func(*http.Request) string) func(http.Handler) http.Handler
- func LogWithContext(ctx context.Context, logLevel LogLevel, component, format string, ...)
- func MigratedChatID(body []byte) string
- func MissingKey(key string)
- func NewContextWithTraceID(ctx context.Context) (context.Context, string)
- func NewContextWithTraceIDValue(ctx context.Context, traceID string) context.Context
- func NewError(format string, v ...interface{}) error
- func Persistent(key string, threshold int, window time.Duration, format string, ...)
- func PostTelegram(chatID, message, parseMode string) (ok bool, retryAfter time.Duration, detail string)
- func Redact(s string) string
- func RememberLocation(ip, country, region, city string)
- func RememberRequestLocation(r *http.Request, ip string)
- func RenderError(tmpl string, err error, r *http.Request, detail string)
- func ResetPersistent(key string)
- func Retry(p RetryPolicy, what string, op func() error) error
- func SendTelegramMessage(message string) bool
- func SendTelegramMessageSync(message string)
- func SendToUserSync(chatID string, message string)
- func SentryBreadcrumb(level LogLevel, formattedLog string)
- func SentryCapture(level LogLevel, formattedLog string)
- func SentryFlush()
- func SentryLog(level LogLevel, formattedLog string)
- func SentryRecover(v interface{})
- func ServiceName() string
- func SetOnChatMigrated(fn func(oldID, newID string) error)
- func SetService(name string)
- func SetTelegramBaseOverride(fn func() string)
- func SetTelegramBaseURL(base string)
- func SetTelegramBotToken(fn func() string)
- func SetTelegramChatID(fn func() string)
- func SetTimeZone(name string)
- func Setup(o Options)
- func StructuredLog(ctx context.Context, level string, component string, message string, ...) string
- func TelegramBase() string
- func Warn(format string, v ...interface{})
- func WriteFailed(what string, err error, r *http.Request, detail string)
- type AppLogger
- type Entry
- type LogLevel
- type Options
- type RetryPolicy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TelegramBotTokenFn func() string TelegramChatIDFn func() string )
View Source
var OnChatMigrated func(oldID, newID string) error
View Source
var TelegramBaseOverrideFn func() string
View Source
var TelegramBaseURL = ""
View Source
var TelegramDurableFn func(chatID, text, parseMode string) error
View Source
var Version = "dev"
Functions ¶
func AppRootDir ¶
func ApplyChatMigration ¶
func ApplyChatMigration(oldID, newID string)
func CurrentTelegramBaseURL ¶
func CurrentTelegramBaseURL() string
func CurrentVersion ¶
func CurrentVersion() string
func EnqueueTelegramAlert ¶
func EnqueueTelegramAlert(message string)
func EscapeMarkdownV2 ¶
func GetTelegramBotToken ¶
func GetTelegramBotToken() string
func GetTelegramChatID ¶
func GetTelegramChatID() string
func GetTraceID ¶
func InitSentry ¶
func IsClientGone ¶
func LocationFromRequest ¶
func LocationMiddleware ¶
func LogWithContext ¶
func MigratedChatID ¶
func MissingKey ¶
func MissingKey(key string)
func NewContextWithTraceID ¶
func Persistent ¶
func PostTelegram ¶
func RememberLocation ¶
func RememberLocation(ip, country, region, city string)
func RememberRequestLocation ¶
func ResetPersistent ¶
func ResetPersistent(key string)
func SendTelegramMessage ¶
func SendTelegramMessageSync ¶
func SendTelegramMessageSync(message string)
func SendToUserSync ¶
func SentryBreadcrumb ¶
func SentryCapture ¶
func SentryFlush ¶
func SentryFlush()
func SentryRecover ¶
func SentryRecover(v interface{})
func ServiceName ¶
func ServiceName() string
func SetOnChatMigrated ¶
func SetService ¶
func SetService(name string)
func SetTelegramBaseOverride ¶
func SetTelegramBaseOverride(fn func() string)
func SetTelegramBaseURL ¶
func SetTelegramBaseURL(base string)
func SetTelegramBotToken ¶
func SetTelegramBotToken(fn func() string)
func SetTelegramChatID ¶
func SetTelegramChatID(fn func() string)
func SetTimeZone ¶
func SetTimeZone(name string)
func StructuredLog ¶
func TelegramBase ¶
func TelegramBase() string
Types ¶
Click to show internal directories.
Click to hide internal directories.