Documentation
¶
Index ¶
- Constants
- Variables
- func Auth(fn func(ctx http.Context) bool)
- func Dump(values ...any)
- func DumpContext(ctx context.Context, values ...any)
- func Filter(fn func(e *Entry) bool)
- func LogDriver() log.Logger
- func Record(ctx context.Context, e *Entry)
- func RecordRedis(ctx context.Context, connection, command string, duration time.Duration, ...)
- func RegisterWatcher(w Watcher)
- func ResolveUser(fn func(ctx http.Context) *User)
- func SetRecorder(r *Recorder)
- func Tag(fn func(e *Entry) []string)
- func Transport(base http.RoundTripper) http.RoundTripper
- func WatchGate(gate access.Gate)
- func WithBatch(ctx context.Context, b *Batch) context.Context
- func WrapArtisan(a console.Artisan) console.Artisan
- func WrapCache(c cache.Cache) cache.Cache
- func WrapEvent(e event.Instance) event.Instance
- func WrapHttp(f client.Factory) client.Factory
- func WrapMail(m mail.Mail) mail.Mail
- func WrapQueue(q queue.Queue) queue.Queue
- func WrapSchedule(s schedule.Schedule, artisan console.Artisan) schedule.Schedule
- type Batch
- type CacheWatcher
- type ClearCommand
- type ClientRequestWatcher
- type Column
- type CommandWatcher
- type Config
- type Dashboard
- type DashboardMiddleware
- type DatabaseStorage
- func (s *DatabaseStorage) Clear(ctx context.Context) error
- func (s *DatabaseStorage) Counts(ctx context.Context) (map[EntryType]int64, error)
- func (s *DatabaseStorage) Find(ctx context.Context, id string) (*Entry, error)
- func (s *DatabaseStorage) Get(ctx context.Context, q Query) ([]*Entry, error)
- func (s *DatabaseStorage) Monitor(ctx context.Context, tags []string) error
- func (s *DatabaseStorage) MonitoredTags(ctx context.Context) ([]string, error)
- func (s *DatabaseStorage) Occurrences(ctx context.Context, familyHash string) (int64, error)
- func (s *DatabaseStorage) Prune(ctx context.Context, before time.Time) (int64, error)
- func (s *DatabaseStorage) Store(ctx context.Context, entries []*Entry) error
- func (s *DatabaseStorage) Unmonitor(ctx context.Context, tags []string) error
- type Describer
- type DumpWatcher
- type Entry
- type EntryType
- type EventWatcher
- type ExceptionWatcher
- type Frame
- type GateWatcher
- type GormPlugin
- type JobWatcher
- type LogWatcher
- type MailWatcher
- type MemoryStorage
- func (m *MemoryStorage) Clear(context.Context) error
- func (m *MemoryStorage) Counts(context.Context) (map[EntryType]int64, error)
- func (m *MemoryStorage) Find(_ context.Context, id string) (*Entry, error)
- func (m *MemoryStorage) Get(_ context.Context, q Query) ([]*Entry, error)
- func (m *MemoryStorage) Monitor(_ context.Context, tags []string) error
- func (m *MemoryStorage) MonitoredTags(context.Context) ([]string, error)
- func (m *MemoryStorage) Occurrences(_ context.Context, familyHash string) (int64, error)
- func (m *MemoryStorage) Prune(_ context.Context, before time.Time) (int64, error)
- func (m *MemoryStorage) Store(_ context.Context, entries []*Entry) error
- func (m *MemoryStorage) Unmonitor(_ context.Context, tags []string) error
- type Middleware
- type Migration
- type ModelWatcher
- type PruneCommand
- type Query
- type QueryWatcher
- type Recorder
- func (r *Recorder) Close()
- func (r *Recorder) Config() *Config
- func (r *Recorder) Dropped() int64
- func (r *Recorder) Flush(timeout time.Duration)
- func (r *Recorder) JoinOrStartBatch() (*Batch, func())
- func (r *Recorder) Record(ctx context.Context, e *Entry)
- func (r *Recorder) RecordException(ctx context.Context, err any, extra map[string]any)
- func (r *Recorder) Recording() bool
- func (r *Recorder) SetRecording(on bool)
- func (r *Recorder) StartBatch() (*Batch, func())
- func (r *Recorder) Storage() Storage
- func (r *Recorder) Suppress() func()
- type RedisWatcher
- type RequestWatcher
- type ScheduleWatcher
- type ServiceProvider
- type Storage
- type User
- type Watcher
- type WatcherInfo
Constants ¶
View Source
const Binding = "goralens"
Variables ¶
View Source
var EntryTypes = []EntryType{ TypeRequest, TypeCommand, TypeSchedule, TypeJob, TypeException, TypeLog, TypeDump, TypeQuery, TypeModel, TypeEvent, TypeMail, TypeCache, TypeRedis, TypeGate, TypeClientRequest, }
Functions ¶
func DumpContext ¶
func RecordRedis ¶
func RegisterWatcher ¶
func RegisterWatcher(w Watcher)
func ResolveUser ¶
func SetRecorder ¶
func SetRecorder(r *Recorder)
func Transport ¶
func Transport(base http.RoundTripper) http.RoundTripper
Types ¶
type CacheWatcher ¶
type CacheWatcher struct {
HiddenKeys []string
}
func (CacheWatcher) Name ¶
func (CacheWatcher) Name() string
func (CacheWatcher) Register ¶
func (CacheWatcher) Register(foundation.Application) error
type ClearCommand ¶
type ClearCommand struct {
// contains filtered or unexported fields
}
func (*ClearCommand) Description ¶
func (c *ClearCommand) Description() string
func (*ClearCommand) Extend ¶
func (c *ClearCommand) Extend() command.Extend
func (*ClearCommand) Signature ¶
func (c *ClearCommand) Signature() string
type ClientRequestWatcher ¶
type ClientRequestWatcher struct{}
func (ClientRequestWatcher) Name ¶
func (ClientRequestWatcher) Name() string
func (ClientRequestWatcher) Register ¶
func (ClientRequestWatcher) Register(foundation.Application) error
type CommandWatcher ¶
type CommandWatcher struct{}
func (CommandWatcher) Name ¶
func (CommandWatcher) Name() string
func (CommandWatcher) Register ¶
func (CommandWatcher) Register(foundation.Application) error
type Config ¶
type Config struct {
Enabled bool
Environment string
Path string
Driver string
Connection string
QueueSize int
FlushInterval time.Duration
IgnorePaths []string
IgnoreCommands []string
HiddenRequestHeaders []string
HiddenResponseHeaders []string
HiddenRequestParameters []string
HiddenResponseParameters []string
ResponseSizeLimit int
Watchers map[EntryType]bool
Middleware []DashboardMiddleware
Key string
TokenStorageKey string
SessionLifetime time.Duration
AllowedUsers map[string][]string
CustomWatchers []Watcher
IgnoreStatusCodes []int
SlowQuery time.Duration
QueryConnections []string
LogLevel string
ExceptionsFromLogs bool
IgnoreAbilities []string
HiddenCacheKeys []string
}
type Dashboard ¶
type Dashboard struct {
// contains filtered or unexported fields
}
func NewDashboard ¶
type DashboardMiddleware ¶
func AllowEmails ¶
func AllowEmails(emails ...string) DashboardMiddleware
func AllowUsers ¶
func AllowUsers(field string, values ...string) DashboardMiddleware
func Authorize ¶
func Authorize() DashboardMiddleware
type DatabaseStorage ¶
type DatabaseStorage struct {
// contains filtered or unexported fields
}
func NewDatabaseStorage ¶
func NewDatabaseStorage(o orm.Orm, connection string) *DatabaseStorage
func (*DatabaseStorage) Monitor ¶
func (s *DatabaseStorage) Monitor(ctx context.Context, tags []string) error
func (*DatabaseStorage) MonitoredTags ¶
func (s *DatabaseStorage) MonitoredTags(ctx context.Context) ([]string, error)
func (*DatabaseStorage) Occurrences ¶
type Describer ¶
type Describer interface {
Describe() WatcherInfo
}
type DumpWatcher ¶
type DumpWatcher struct{}
func (DumpWatcher) Name ¶
func (DumpWatcher) Name() string
func (DumpWatcher) Register ¶
func (DumpWatcher) Register(foundation.Application) error
type Entry ¶
type Entry struct {
Sequence int64 `json:"sequence"`
UUID string `json:"uuid"`
BatchID string `json:"batch_id"`
FamilyHash string `json:"family_hash,omitempty"`
Type EntryType `json:"type"`
Content map[string]any `json:"content"`
Tags []string `json:"tags"`
CreatedAt time.Time `json:"created_at"`
DisplayOnIndex bool `json:"-"`
}
type EntryType ¶
type EntryType string
const ( TypeRequest EntryType = "request" TypeCommand EntryType = "command" TypeSchedule EntryType = "schedule" TypeJob EntryType = "job" TypeException EntryType = "exception" TypeLog EntryType = "log" TypeDump EntryType = "dump" TypeQuery EntryType = "query" TypeModel EntryType = "model" TypeEvent EntryType = "event" TypeMail EntryType = "mail" TypeCache EntryType = "cache" TypeRedis EntryType = "redis" TypeGate EntryType = "gate" TypeClientRequest EntryType = "client_request" )
type EventWatcher ¶
type EventWatcher struct{}
func (EventWatcher) Name ¶
func (EventWatcher) Name() string
func (EventWatcher) Register ¶
func (EventWatcher) Register(foundation.Application) error
type ExceptionWatcher ¶
type ExceptionWatcher struct {
IgnoreErrorLogs bool
}
func (ExceptionWatcher) Name ¶
func (ExceptionWatcher) Name() string
func (ExceptionWatcher) Register ¶
func (ExceptionWatcher) Register(foundation.Application) error
type GateWatcher ¶
type GateWatcher struct {
IgnoreAbilities []string
}
func (GateWatcher) Name ¶
func (GateWatcher) Name() string
func (GateWatcher) Register ¶
func (GateWatcher) Register(foundation.Application) error
type GormPlugin ¶
type GormPlugin struct {
Connection string
}
func (GormPlugin) Initialize ¶
func (p GormPlugin) Initialize(db *gorm.DB) error
func (GormPlugin) Name ¶
func (GormPlugin) Name() string
type JobWatcher ¶
type JobWatcher struct{}
func (JobWatcher) Name ¶
func (JobWatcher) Name() string
func (JobWatcher) Register ¶
func (JobWatcher) Register(foundation.Application) error
type LogWatcher ¶
type LogWatcher struct {
Level string
}
func (LogWatcher) Name ¶
func (LogWatcher) Name() string
func (LogWatcher) Register ¶
func (LogWatcher) Register(foundation.Application) error
type MailWatcher ¶
type MailWatcher struct{}
func (MailWatcher) Name ¶
func (MailWatcher) Name() string
func (MailWatcher) Register ¶
func (MailWatcher) Register(foundation.Application) error
type MemoryStorage ¶
type MemoryStorage struct {
Limit int
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage(limit int) *MemoryStorage
func (*MemoryStorage) Monitor ¶
func (m *MemoryStorage) Monitor(_ context.Context, tags []string) error
func (*MemoryStorage) MonitoredTags ¶
func (m *MemoryStorage) MonitoredTags(context.Context) ([]string, error)
func (*MemoryStorage) Occurrences ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func NewMiddleware ¶
func NewMiddleware(r *Recorder) *Middleware
func (*Middleware) Handle ¶
func (m *Middleware) Handle(ctx http.Context)
func (*Middleware) Signature ¶
func (m *Middleware) Signature() string
type ModelWatcher ¶
type ModelWatcher struct{}
func (ModelWatcher) Name ¶
func (ModelWatcher) Name() string
func (ModelWatcher) Register ¶
func (ModelWatcher) Register(foundation.Application) error
type PruneCommand ¶
type PruneCommand struct {
// contains filtered or unexported fields
}
func (*PruneCommand) Description ¶
func (c *PruneCommand) Description() string
func (*PruneCommand) Extend ¶
func (c *PruneCommand) Extend() command.Extend
func (*PruneCommand) Signature ¶
func (c *PruneCommand) Signature() string
type QueryWatcher ¶
func (QueryWatcher) Name ¶
func (QueryWatcher) Name() string
func (QueryWatcher) Register ¶
func (QueryWatcher) Register(foundation.Application) error
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func (*Recorder) JoinOrStartBatch ¶
func (*Recorder) RecordException ¶
func (*Recorder) SetRecording ¶
func (*Recorder) StartBatch ¶
type RedisWatcher ¶
type RedisWatcher struct{}
func (RedisWatcher) Name ¶
func (RedisWatcher) Name() string
func (RedisWatcher) Register ¶
func (RedisWatcher) Register(foundation.Application) error
type RequestWatcher ¶
func (RequestWatcher) Name ¶
func (RequestWatcher) Name() string
func (RequestWatcher) Register ¶
func (RequestWatcher) Register(foundation.Application) error
type ScheduleWatcher ¶
type ScheduleWatcher struct{}
func (ScheduleWatcher) Name ¶
func (ScheduleWatcher) Name() string
func (ScheduleWatcher) Register ¶
func (ScheduleWatcher) Register(foundation.Application) error
type ServiceProvider ¶
type ServiceProvider struct{}
func (*ServiceProvider) Boot ¶
func (r *ServiceProvider) Boot(a foundation.Application)
func (*ServiceProvider) Register ¶
func (r *ServiceProvider) Register(a foundation.Application)
func (*ServiceProvider) Relationship ¶
func (r *ServiceProvider) Relationship() binding.Relationship
type Storage ¶
type Storage interface {
Store(ctx context.Context, entries []*Entry) error
Get(ctx context.Context, q Query) ([]*Entry, error)
Find(ctx context.Context, uuid string) (*Entry, error)
Occurrences(ctx context.Context, familyHash string) (int64, error)
Counts(ctx context.Context) (map[EntryType]int64, error)
Prune(ctx context.Context, before time.Time) (int64, error)
Clear(ctx context.Context) error
MonitoredTags(ctx context.Context) ([]string, error)
Monitor(ctx context.Context, tags []string) error
Unmonitor(ctx context.Context, tags []string) error
}
type User ¶
type User struct {
ID any `json:"id"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
Attributes map[string]any `json:"attributes,omitempty"`
}
func CurrentUser ¶
type Watcher ¶
type Watcher interface {
Name() string
Register(app foundation.Application) error
}
func DefaultWatchers ¶
func DefaultWatchers() []Watcher
Source Files
¶
- access.go
- batch.go
- builtin_watchers.go
- commands.go
- config.go
- dashboard.go
- entry.go
- goralens.go
- migration.go
- recorder.go
- redact.go
- service_provider.go
- session.go
- storage.go
- storage_database.go
- storage_memory.go
- watcher.go
- watcher_cache.go
- watcher_command.go
- watcher_dump.go
- watcher_event.go
- watcher_exception.go
- watcher_gate.go
- watcher_http_client.go
- watcher_log.go
- watcher_mail.go
- watcher_query.go
- watcher_queue.go
- watcher_redis.go
- watcher_request.go
- watcher_schedule.go
Click to show internal directories.
Click to hide internal directories.

