Documentation ¶
Index ¶
- type GetEntriesFilter
- type GetEntriesFilterOption
- func WithFrom(from time.Time) GetEntriesFilterOption
- func WithLevel(level string) GetEntriesFilterOption
- func WithMetaFilters(filters map[string]interface{}) GetEntriesFilterOption
- func WithSelectedMetaKeys(keys ...string) GetEntriesFilterOption
- func WithSession(session string) GetEntriesFilterOption
- func WithTo(to time.Time) GetEntriesFilterOption
- type LogEntry
- type LogEntryMeta
- type LogEntryType
- type LogWriter
- type LoggerConfig
- type MetaKey
- type MetaKeys
- type MissingDBFileError
- type Row
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetEntriesFilter ¶
type GetEntriesFilter struct { Level string Session string From time.Time To time.Time SelectedMetaKeys []string MetaFilters map[string]interface{} }
func NewGetEntriesFilter ¶
func NewGetEntriesFilter(opts ...GetEntriesFilterOption) *GetEntriesFilter
func (*GetEntriesFilter) Apply ¶
func (gef *GetEntriesFilter) Apply(metaKeys *MetaKeys, q *sqlbuilder.SelectBuilder)
type GetEntriesFilterOption ¶
type GetEntriesFilterOption func(*GetEntriesFilter)
func WithFrom ¶
func WithFrom(from time.Time) GetEntriesFilterOption
func WithLevel ¶
func WithLevel(level string) GetEntriesFilterOption
func WithMetaFilters ¶
func WithMetaFilters(filters map[string]interface{}) GetEntriesFilterOption
func WithSelectedMetaKeys ¶
func WithSelectedMetaKeys(keys ...string) GetEntriesFilterOption
func WithSession ¶
func WithSession(session string) GetEntriesFilterOption
func WithTo ¶
func WithTo(to time.Time) GetEntriesFilterOption
type LogEntryMeta ¶
type LogEntryMeta struct { ID int `db:"id"` LogEntryID int `db:"log_entry_id"` Type LogEntryType `db:"type"` Name *string `db:"name"` MetaKeyID *int `db:"meta_key_id"` IntValue *int64 `db:"int_value"` RealValue *float64 `db:"real_value"` TextValue *string `db:"text_value"` BlobValue *[]byte `db:"blob_value"` MetaKey *string `db:"meta_key"` }
func (*LogEntryMeta) Value ¶
func (lem *LogEntryMeta) Value() (interface{}, error)
type LogEntryType ¶
type LogEntryType int
LogEntryType represents the different types LogEntries can have.
const ( LogEntryTypeReal LogEntryType = iota LogEntryTypeText LogEntryTypeBlob LogEntryTypeJSON )
func ToLogEntryType ¶
func ToLogEntryType(v interface{}) LogEntryType
func (LogEntryType) String ¶
func (t LogEntryType) String() string
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
LogWriter is the main class in Plunger.
It deserializes the JSON binaries handed over by zerolog, and decomposes the message into the database schema specified at creation time.
func InitLogging ¶
func InitLogging(config *LoggerConfig) (*LogWriter, *sqlx.DB, error)
func (*LogWriter) GetEntries ¶
func (l *LogWriter) GetEntries(filter *GetEntriesFilter) ([]*LogEntry, error)
type LoggerConfig ¶
type MetaKey ¶
MetaKey is used to store keys that are often used, to avoid storing them as full strings. Instead, we store them by id and use a lookup table to get the full string.
type MetaKeys ¶
MetaKeys is a collection of MetaKey. It is used to quickly manage adding new keys.
func NewMetaKeys ¶
func NewMetaKeys() *MetaKeys
type MissingDBFileError ¶
type MissingDBFileError struct { }
func (*MissingDBFileError) Error ¶
func (e *MissingDBFileError) Error() string
type Row ¶
type Row struct { Name string Type LogEntryType }
Click to show internal directories.
Click to hide internal directories.