ops

package
v0.31.8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Approval

type Approval struct {
	ID          string      `json:"id"`
	Type        string      `json:"type"`
	Status      string      `json:"status"`
	RequestedAt time.Time   `json:"requested_at"`
	UpdatedAt   time.Time   `json:"updated_at"`
	ReviewedAt  *time.Time  `json:"reviewed_at,omitempty"`
	Plan        CleanupPlan `json:"plan"`
	Note        string      `json:"note,omitempty"`
}

type CleanupApplyResult

type CleanupApplyResult struct {
	ApprovalID   string   `json:"approval_id"`
	DeletedCount int      `json:"deleted_count"`
	DeletedBytes int64    `json:"deleted_bytes"`
	Errors       []string `json:"errors,omitempty"`
}

type CleanupCandidate

type CleanupCandidate struct {
	Path      string `json:"path"`
	SizeBytes int64  `json:"size_bytes"`
	Reason    string `json:"reason,omitempty"`
}

type CleanupPlan

type CleanupPlan struct {
	ApprovalID string             `json:"approval_id"`
	CreatedAt  time.Time          `json:"created_at"`
	TotalBytes int64              `json:"total_bytes"`
	Candidates []CleanupCandidate `json:"candidates"`
}

type Manager

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

func NewManager

func NewManager(workspaceDir string, opts Options) *Manager

func (*Manager) ApplyCleanup

func (m *Manager) ApplyCleanup(ctx context.Context, approvalID string) (CleanupApplyResult, error)

func (*Manager) Approve

func (m *Manager) Approve(approvalID string) error

func (*Manager) CreateCleanupPlan

func (m *Manager) CreateCleanupPlan(ctx context.Context) (CleanupPlan, error)

func (*Manager) ListApprovals

func (m *Manager) ListApprovals() ([]Approval, error)

func (*Manager) Reject

func (m *Manager) Reject(approvalID string) error

func (*Manager) SetNote added in v0.14.0

func (m *Manager) SetNote(approvalID, note string) error

SetNote updates the note field of an approval record.

func (*Manager) Status

func (m *Manager) Status(ctx context.Context) (Status, error)

type Options

type Options struct {
	HomeDir    string
	Now        func() time.Time
	MinFileAge time.Duration
}

type Status

type Status struct {
	Timestamp       time.Time `json:"timestamp"`
	DiskTotalBytes  uint64    `json:"disk_total_bytes"`
	DiskFreeBytes   uint64    `json:"disk_free_bytes"`
	DiskUsedPercent float64   `json:"disk_used_percent"`
	ProcessCount    int       `json:"process_count"`
}

Jump to

Keyboard shortcuts

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