log

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package log provides audit log querying for both local SQLite and remote API sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Agent       string
	Token       string
	Identity    string // "anonymous", "declared", "issued"
	Credential  string
	Domain      string
	Method      string
	Environment string // "development", "staging", "production"
	Status      int
	StatusClass string // "2xx", "4xx", "5xx", "error"
	Failed      bool
	Blocked     bool
	Redacted    bool
	ProjectID   string
	Since       time.Time
	Until       time.Time
	Limit       int
	Offset      int
}

Filter holds all options for querying audit logs.

type Service

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

Service provides methods to query local and cloud audit logs.

func NewService

func NewService(client *api.Client, db *sql.DB) (*Service, error)

NewService creates a new log service. If db is nil, it tries to connect to the default local SQLite DB.

func (*Service) Close

func (s *Service) Close() error

Close closes the local database connection.

func (*Service) GetLog

func (s *Service) GetLog(id string) (*proxy.AuditEvent, error)

GetLog returns a single log entry by ID.

func (*Service) QueryLocal

func (s *Service) QueryLocal(f Filter) ([]proxy.AuditEvent, error)

QueryLocal fetches audit events from the local SQLite database.

Jump to

Keyboard shortcuts

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