Documentation ¶
Index ¶
- type Option
- type TelegramHook
- func (h *TelegramHook) ApiEndpoint() string
- func (h *TelegramHook) AppName() string
- func (h *TelegramHook) Async() bool
- func (h *TelegramHook) AuthToken() string
- func (h *TelegramHook) ChatId() string
- func (h *TelegramHook) Fire(entry *logrus.Entry) error
- func (h *TelegramHook) Level() logrus.Level
- func (h *TelegramHook) Levels() []logrus.Level
- func (h *TelegramHook) SetAppName(appName string)
- func (h *TelegramHook) SetAsync(async bool)
- func (h *TelegramHook) SetAuthToken(authToken string)
- func (h *TelegramHook) SetChatId(chatId string)
- func (h *TelegramHook) SetLevel(level logrus.Level)
- func (h *TelegramHook) SetThreadId(threadId string)
- func (h *TelegramHook) ThreadId() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*TelegramHook)
Option defines a method for additional configuration when instantiating TelegramHook
func WithTimeout ¶
Timeout sets http call timeout for telegram client
type TelegramHook ¶
type TelegramHook struct {
// contains filtered or unexported fields
}
TelegramHook to send logs via the Telegram API.
func NewTelegramHook ¶
func NewTelegramHook(appName, authToken, chatId, threadId string, options ...Option) (*TelegramHook, error)
New creates a new instance of a hook targeting the Telegram API.
func NewTelegramHookWithClient ¶
func NewTelegramHookWithClient(appName, authToken, chatId, threadId string, client *http.Client, options ...Option) (*TelegramHook, error)
NewTelegramHookWithClient creates a new instance of a hook targeting the Telegram API with custom http.Client.
func (*TelegramHook) Fire ¶
func (h *TelegramHook) Fire(entry *logrus.Entry) error
Fire emits a log message to the Telegram API.
func (*TelegramHook) Levels ¶
func (h *TelegramHook) Levels() []logrus.Level
Levels returns the log levels that the hook should be enabled for.
func (*TelegramHook) SetAppName ¶
func (h *TelegramHook) SetAppName(appName string)
func (*TelegramHook) SetAsync ¶
func (h *TelegramHook) SetAsync(async bool)
func (*TelegramHook) SetAuthToken ¶
func (h *TelegramHook) SetAuthToken(authToken string)
func (*TelegramHook) SetChatId ¶
func (h *TelegramHook) SetChatId(chatId string)
func (*TelegramHook) SetLevel ¶
func (h *TelegramHook) SetLevel(level logrus.Level)
func (*TelegramHook) SetThreadId ¶
func (h *TelegramHook) SetThreadId(threadId string)
Click to show internal directories.
Click to hide internal directories.