Help us shape the future of Go! Take the 2026 Go Developer Survey

pglog

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pglog provides helpers for a Postgres logs processing.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound defines an error if last session activity not found.
	ErrNotFound = errors.New("pglog activity: not found")

	// ErrLastFile defines an error if no more recent log files to discover last activity.
	ErrLastFile = errors.New("no more recent log files")

	// ErrTimeBoundary defines an error if the upper boundary of the interval exceeded.
	ErrTimeBoundary = errors.New("time boundary exceeded")
)

Functions

func ParsePostgresLastActivity

func ParsePostgresLastActivity(logTime, text string) (*time.Time, error)

ParsePostgresLastActivity extracts the time of last session activity.

Types

type Selector

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

Selector describes a struct to select CSV log files.

func NewSelector

func NewSelector(dir string) *Selector

NewSelector creates a new Selector.

func (*Selector) DiscoverLogDir

func (s *Selector) DiscoverLogDir() error

DiscoverLogDir discovers available CSV log files.

func (*Selector) FilterOldFilesInList

func (s *Selector) FilterOldFilesInList()

FilterOldFilesInList filters the original filename list.

func (*Selector) Next

func (s *Selector) Next() (string, error)

Next returns the next CSV log filename to discover.

func (*Selector) SetMinimumTime

func (s *Selector) SetMinimumTime(minimumTime time.Time)

SetMinimumTime sets a minimum allowable time.

Jump to

Keyboard shortcuts

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