logfiles

package
v0.0.0-...-8aeb8a1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DateExtractRegexp = regexp.MustCompile("incoming.tok=.*-(\\d{4}-\\d{2}-\\d{2}T\\d{2}-\\d{2}-\\d{2})")

Functions

This section is empty.

Types

type Archiver

type Archiver struct {
	// contains filtered or unexported fields
}

func NewArchiver

func NewArchiver(sourceDir, archiveDir string) *Archiver

func (*Archiver) Archive

func (a *Archiver) Archive(fileName string) error

Archive write new archived file and delete old one

func (*Archiver) ArchiveByPath

func (a *Archiver) ArchiveByPath(sourceFilePath string) error

ArchiveByPath write new archived file and delete old one

type PeriodicArchiver

type PeriodicArchiver struct {
	// contains filtered or unexported fields
}

PeriodicArchiver archive log files every configurable unit of time uses Archiver under the hood

func NewPeriodicArchiver

func NewPeriodicArchiver(fileMask, archiveDir string, archiveEvery time.Duration) *PeriodicArchiver

NewPeriodicArchiver return PeriodicArchiver and start observer goroutine

func (*PeriodicArchiver) Close

func (pa *PeriodicArchiver) Close() error

type PeriodicUploader

type PeriodicUploader struct {
	// contains filtered or unexported fields
}

PeriodicUploader read already rotated and closed log files Pass them to storages according to tokens Keep uploading log file with result statuses

func NewUploader

func NewUploader(logEventPath, fileMask string, defaultBatchPeriodMin int, concurrentUploads int, destinationService *destinations.Service) (*PeriodicUploader, error)

NewUploader returns new configured PeriodicUploader instance

func (*PeriodicUploader) Start

func (u *PeriodicUploader) Start()

Start reading event logger log directory and finding already rotated and closed files by mask pass them to storages according to tokens keep uploading log statuses file for every event log file

type Status

type Status struct {
	Uploaded bool   `json:"uploaded"`
	Err      string `json:"error"`
}

type StatusManager

type StatusManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStatusManager

func NewStatusManager(logFilesDir string) (*StatusManager, error)

func (*StatusManager) CleanUp

func (sm *StatusManager) CleanUp(fileName string)

func (*StatusManager) GetTablesStatuses

func (sm *StatusManager) GetTablesStatuses(fileName, storageName string) map[string]*Status

func (*StatusManager) UpdateStatus

func (sm *StatusManager) UpdateStatus(fileName, storage, table string, err error)

Jump to

Keyboard shortcuts

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