Documentation ¶
Index ¶
- Constants
- type AuthMode
- type Config
- type Log
- func (l *Log) Close() error
- func (l *Log) EmitAuditEvent(ctx context.Context, event apievents.AuditEvent) error
- func (l *Log) SearchEvents(ctx context.Context, req events.SearchEventsRequest) ([]apievents.AuditEvent, string, error)
- func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionEventsRequest) ([]apievents.AuditEvent, string, error)
Constants ¶
const ( Schema = "postgres" AltSchema = "postgresql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMode ¶
type AuthMode string
AuthMode determines if we should use some environment-specific authentication mechanism or credentials.
type Config ¶
type Config struct { Log logrus.FieldLogger PoolConfig *pgxpool.Config AuthMode AuthMode DisableCleanup bool RetentionPeriod time.Duration CleanupInterval time.Duration }
Config is the configuration struct to pass to New.
func (*Config) CheckAndSetDefaults ¶
CheckAndSetDefaults checks if the Config is valid, setting default parameters where they're unset. PoolConfig is only checked for presence.
func (*Config) SetFromURL ¶
SetFromURL sets config params from the URL, as per pgxpool.ParseConfig (with some additional query params in the fragment for our own options).
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is an external events.AuditLogger backed by a PostgreSQL database.
func New ¶
Returns a new Log given a Config. Starts a background cleanup task unless disabled in the Config.
func (*Log) EmitAuditEvent ¶
EmitAuditEvent implements events.AuditLogger.
func (*Log) SearchEvents ¶
func (l *Log) SearchEvents(ctx context.Context, req events.SearchEventsRequest) ([]apievents.AuditEvent, string, error)
SearchEvents implements events.AuditLogger.
func (*Log) SearchSessionEvents ¶
func (l *Log) SearchSessionEvents(ctx context.Context, req events.SearchSessionEventsRequest) ([]apievents.AuditEvent, string, error)
SearchSessionEvents implements events.AuditLogger.