Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AppName string
AppName exposes application name to config module
Functions ¶
Types ¶
type Config ¶
type Config struct { File string Host string `yaml:"host"` Port int `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` Database string `yaml:"database"` SSLMode string `yaml:"sslmode"` Interval float64 `yaml:"interval"` ConnectTimeout int `yaml:"connect-timeout"` IdleTimeout float64 `yaml:"idle-timeout"` ActiveTimeout float64 `yaml:"active-timeout"` LogDestination string `yaml:"log-destination"` LogFile string `yaml:"log-file"` LogFormat string `yaml:"log-format"` PidFile string `yaml:"pid-file"` SyslogIdent string `yaml:"syslog-ident"` SyslogFacility string `yaml:"syslog-facility"` IncludeUsers StringFlags `yaml:"include-users"` IncludeUsersRegex string `yaml:"include-users-regex"` IncludeUsersRegexCompiled *regexp.Regexp IncludeUsersFilters []Filter ExcludeUsers StringFlags `yaml:"exclude-users"` ExcludeUsersRegex string `yaml:"exclude-users-regex"` ExcludeUsersRegexCompiled *regexp.Regexp ExcludeUsersFilters []Filter IncludeDatabases StringFlags `yaml:"include-databases"` IncludeDatabasesRegex string `yaml:"include-databases-regex"` IncludeDatabasesRegexCompiled *regexp.Regexp IncludeDatabasesFilters []Filter ExcludeDatabases StringFlags `yaml:"exclude-databases"` ExcludeDatabasesRegex string `yaml:"exclude-databases-regex"` ExcludeDatabasesRegexCompiled *regexp.Regexp ExcludeDatabasesFilters []Filter ExcludeListeners bool `yaml:"exclude-listeners"` Cancel bool `yaml:"cancel"` // contains filtered or unexported fields }
Config receives configuration options
func (*Config) CompileFilters ¶ added in v1.0.0
func (c *Config) CompileFilters()
CompileFilters creates Filter objects based on patterns and compiled regexp
func (*Config) CompileRegexes ¶ added in v0.1.3
CompileRegexes transforms regexes from string to regexp instance
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db centralizes connection to the database
func (*Db) CancelSessions ¶ added in v0.1.3
CancelSessions terminates current query of a list of sessions
func (*Db) Connect ¶
func (db *Db) Connect()
Connect connects to the instance and ping it to ensure connection is working
func (*Db) TerminateSessions ¶
TerminateSessions terminates a list of sessions
type ExcludeFilter ¶ added in v1.0.0
type ExcludeFilter struct {
// contains filtered or unexported fields
}
ExcludeFilter to include a string when it's not included in a list of strings
func NewExcludeFilter ¶ added in v1.0.0
func NewExcludeFilter(patterns []string) ExcludeFilter
NewExcludeFilter to create an ExcludeFilter
func (ExcludeFilter) Include ¶ added in v1.0.0
func (f ExcludeFilter) Include(s string) bool
Include returns true when the string is not included in the patterns Implements the Filter interface
func (ExcludeFilter) String ¶ added in v1.0.0
func (f ExcludeFilter) String() string
String to pretty print an ExcludeFilter Implements the Filter interface
type ExcludeFilterRegex ¶ added in v1.0.0
type ExcludeFilterRegex struct {
// contains filtered or unexported fields
}
ExcludeFilterRegex to include a string when it doesnn't match a regex
func NewExcludeFilterRegex ¶ added in v1.0.0
func NewExcludeFilterRegex(regex *regexp.Regexp) ExcludeFilterRegex
NewExcludeFilterRegex to create an ExcludeFilterRegex
func (ExcludeFilterRegex) Include ¶ added in v1.0.0
func (f ExcludeFilterRegex) Include(s string) bool
Include returns true when the string doesn't match the regex Implements the Filter interface
func (ExcludeFilterRegex) String ¶ added in v1.0.0
func (f ExcludeFilterRegex) String() string
String to pretty print an ExcludeFilterRegex Implements the Filter interface
type IncludeFilter ¶ added in v1.0.0
type IncludeFilter struct {
// contains filtered or unexported fields
}
IncludeFilter to include a string when it's included in a list of strings
func NewIncludeFilter ¶ added in v1.0.0
func NewIncludeFilter(patterns []string) IncludeFilter
NewIncludeFilter to create an IncludeFilter
func (IncludeFilter) Include ¶ added in v1.0.0
func (f IncludeFilter) Include(s string) bool
Include returns true when a string is included in a list of patterns Implements the Filter interface
func (IncludeFilter) String ¶ added in v1.0.0
func (f IncludeFilter) String() string
String to pretty print an IncludeFilter Implements the Filter interface
type IncludeFilterRegex ¶ added in v1.0.0
type IncludeFilterRegex struct {
// contains filtered or unexported fields
}
IncludeFilterRegex to include a string when it matches a regex
func NewIncludeFilterRegex ¶ added in v1.0.0
func NewIncludeFilterRegex(regex *regexp.Regexp) IncludeFilterRegex
NewIncludeFilterRegex to create an IncludeFilterRegex
func (IncludeFilterRegex) Include ¶ added in v1.0.0
func (f IncludeFilterRegex) Include(s string) bool
Include returns true when the string matches the regex Implements the Filter interface
func (IncludeFilterRegex) String ¶ added in v1.0.0
func (f IncludeFilterRegex) String() string
String to pretty print an IncludeFilterRegex Implements the Filter interface
type Session ¶
type Session struct { Pid int64 User string Db string Client string State string Query string StateDuration float64 ApplicationName string }
Session represents a PostgreSQL backend
func NewSession ¶
func NewSession(pid int64, user string, db string, client string, state string, query string, stateDuration float64, applicationName string) *Session
NewSession instanciates a Session
func (*Session) Equal ¶ added in v1.0.1
Equal returns true when two sessions share the same process id
func (*Session) Format ¶ added in v0.1.5
Format returns a Session as a string by replacing placeholders with their respective value
type StringFlags ¶ added in v0.1.3
type StringFlags []string
StringFlags append multiple string flags into a string slice
func (*StringFlags) Set ¶ added in v0.1.3
func (s *StringFlags) Set(value string) error
Set adds alues into the slice
func (*StringFlags) String ¶ added in v0.1.3
func (s *StringFlags) String() string
String for implementing flag interface