util

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: BSD-2-Clause, BSD-3-Clause, PostgreSQL Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CollectorNameAndVersion = "pganalyze-collector " + CollectorVersion
View Source
const CollectorVersion = "0.37.1"

Variables

This section is empty.

Functions

func BoolPtrToBool

func BoolPtrToBool(ptr *bool) bool

func FingerprintQuery

func FingerprintQuery(query string) (fp [21]byte)

FingerprintQuery - Generates a unique SHA-1 fingerprint for the given query

func IntPtrToInt

func IntPtrToInt(ptr *int64) int64

func IntPtrToString

func IntPtrToString(ptr *int64) int64

func IsUtilityStmt

func IsUtilityStmt(query string) ([]bool, error)

IsUtilityStmt determines whether each statement in the query text is a utility statement or a standard SELECT/INSERT/UPDATE/DELETE statement.

func NormalizeQuery

func NormalizeQuery(query string, filterQueryText string, trackActivityQuerySize int) string

func Reload

func Reload() (reloadedPid int, err error)

func StringPtrToString

func StringPtrToString(ptr *string) string

func TimePtrToTime

func TimePtrToTime(ptr *time.Time) time.Time

func TimePtrToUnixTimestamp

func TimePtrToUnixTimestamp(ptr *time.Time) int64

Types

type Logger

type Logger struct {
	Verbose        bool
	Quiet          bool
	Prefix         *string
	Destination    *log.Logger
	RememberErrors bool
	ErrorMessages  []string
}

func (*Logger) PrintError

func (logger *Logger) PrintError(format string, args ...interface{})

func (*Logger) PrintInfo

func (logger *Logger) PrintInfo(format string, args ...interface{})

func (*Logger) PrintVerbose

func (logger *Logger) PrintVerbose(format string, args ...interface{})

func (*Logger) PrintWarning

func (logger *Logger) PrintWarning(format string, args ...interface{})

func (*Logger) WithPrefix

func (logger *Logger) WithPrefix(prefix string) *Logger

func (*Logger) WithPrefixAndRememberErrors

func (logger *Logger) WithPrefixAndRememberErrors(prefix string) *Logger

type Timestamp

type Timestamp timestamp.Timestamp

func (*Timestamp) Scan

func (ts *Timestamp) Scan(value interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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