logging

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryLogStore

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

func NewInMemoryLogStore

func NewInMemoryLogStore(maxLength uint) *InMemoryLogStore

func (*InMemoryLogStore) GetLogEntries

func (store *InMemoryLogStore) GetLogEntries() ([]*LogEntry, error)

func (*InMemoryLogStore) GetLogEntry

func (store *InMemoryLogStore) GetLogEntry(id interface{}) (*LogEntry, error)

func (*InMemoryLogStore) InsertLogEntry

func (store *InMemoryLogStore) InsertLogEntry(log *LogEntry) error

type LogEntry

type LogEntry struct {
	ID          interface{}
	ActionTime  time.Time
	UserID      interface{}
	UserRepr    string
	ContentType string
	ObjectID    interface{}
	ObjectRepr  string
	ActionFlag  LogStoreLevel
	Message     string
}

func (*LogEntry) Repr

func (l *LogEntry) Repr() string

type LogStore

type LogStore interface {
	InsertLogEntry(logEntry *LogEntry) error
	GetLogEntry(id interface{}) (*LogEntry, error)
	GetLogEntries() ([]*LogEntry, error)
}

type LogStoreLevel

type LogStoreLevel string
const (
	LogStoreLevelDelete       LogStoreLevel = "delete"
	LogStoreLevelCreate       LogStoreLevel = "create"
	LogStoreLevelUpdate       LogStoreLevel = "update"
	LogStoreLevelInstanceView LogStoreLevel = "instance_view"
	LogStoreLevelListView     LogStoreLevel = "list_view"
	LogStoreLevelPanelView    LogStoreLevel = "panel_view"
)

func (LogStoreLevel) AssessLevel

func (l LogStoreLevel) AssessLevel(assessmentLevel LogStoreLevel) bool

Jump to

Keyboard shortcuts

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