auditlog

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	CreatedAt string `json:"created_at"`

	// Action is a short, stable identifier (e.g. "session_opened", "codespace_start").
	Action string `json:"action"`

	// Status is "success" or "failure".
	Status string `json:"status"`

	// Error is a human-readable error summary (best-effort, non-secret).
	Error string `json:"error,omitempty"`

	ChannelID string `json:"channel_id,omitempty"`

	EnvPublicID       string `json:"env_public_id,omitempty"`
	NamespacePublicID string `json:"namespace_public_id,omitempty"`

	UserPublicID string `json:"user_public_id,omitempty"`
	UserEmail    string `json:"user_email,omitempty"`

	FloeApp     string `json:"floe_app,omitempty"`
	SessionKind string `json:"session_kind,omitempty"`
	CodeSpaceID string `json:"code_space_id,omitempty"`
	TunnelURL   string `json:"tunnel_url,omitempty"`
	CanRead     bool   `json:"can_read"`
	CanWrite    bool   `json:"can_write"`
	CanExecute  bool   `json:"can_execute"`
	CanAdmin    bool   `json:"can_admin"`

	// Detail is a small, action-specific object (avoid secrets).
	Detail map[string]any `json:"detail,omitempty"`
}

type Options

type Options struct {
	Logger *slog.Logger
	// StateDir is the runtime state directory (e.g. ~/.redeven).
	StateDir string

	// MaxBytes limits the size of a single audit log file (rotation threshold).
	// If <= 0, a safe default is used.
	MaxBytes int64
	// MaxBackups keeps the latest N rotated files (in addition to the active file).
	// If <= 0, a safe default is used.
	MaxBackups int
}

type Store

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

func New

func New(opts Options) (*Store, error)

func (*Store) Append

func (s *Store) Append(e Entry)

func (*Store) List

func (s *Store) List(limit int) ([]Entry, error)

Jump to

Keyboard shortcuts

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