loki

package
v0.0.0-...-70ba3d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2025 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LastReadTime time.Time

LastReadTime - время последнего чтения логов

View Source
var MapLastErrors = make(map[string]string)

MapLastErrors - хранит предыдущие ошибки

View Source
var Ticker *time.Ticker

Ticker - таймер, запускается каждые INTERVAL_SEND_MINUTES (10) минут

Functions

func FindTextWithoutTime

func FindTextWithoutTime(TextLog string) string

FindTextWithoutTime - убирает время в логе, для этого берём текст после 2 пробела time="2024-11-07 04:30:53.709" level=error msg="GetExtractEgripEgrul INN: 519300250706 Result: map[address: fullName: shortName: state:] Error: 404 Нет данных по данному ИНН: 519300250706" func="TakeMessageAsync()\t" file=" nats.go:194\t" 2024/11/01 04:35:07.872721 [ERROR] syncMessage, contractId: 7802, error: NewBriefCase, initInvoices, error: there is no documents for this contract

func FindURLLoki

func FindURLLoki(ServiceName string, DateFrom, DateTo time.Time) string

FindURLLoki - находит URL ссылку в LOKI на которую можно кликнуть в телеграмме

func ReadTicker

func ReadTicker()

ReadTicker - запускается каждые INTERVAL_SEND_MINUTES минут

func Start

func Start()

Start - старт работы чтения логов LOKI

func Start_period

func Start_period(Date1, Date2 time.Time)

Start_period - запускает чтение логов всех сервисов за период

func Start_period1

func Start_period1(Message1 *types.Message, DateFrom, DateTo time.Time) error

Start_period1 - запускает чтение логов одного сервиса за период возвращает Текст отправленного сообщения, и ошибку

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL