support

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package support builds daemon-owned support bundles and tracks bundle operations.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOperationNotFound = errors.New("support: bundle operation not found")
	ErrOperationNotReady = errors.New("support: bundle operation is not ready for download")
)

Functions

func BundlesDir

func BundlesDir(paths aghconfig.HomePaths) string

Types

type Builder

type Builder struct {
	HomePaths            aghconfig.HomePaths
	Config               aghconfig.Config
	ConfigSnapshot       ConfigSnapshotFunc
	Sources              Sources
	Now                  func() time.Time
	BundleMaxBytes       int64
	ArtifactMaxBytes     int64
	LogTailMaxBytes      int64
	EventSummaryMaxBytes int64
}

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, operationID string, req CreateRequest) (operation Operation, err error)

type ConfigSnapshotFunc

type ConfigSnapshotFunc func(context.Context) (aghconfig.Config, error)

type CreateRequest

type CreateRequest struct {
	IncludeStatus bool
}

type HomeTreeEntry

type HomeTreeEntry struct {
	Path string `json:"path"`
	Kind string `json:"kind"`
	Size int64  `json:"size"`
	Mode string `json:"mode"`
}

type Manifest

type Manifest struct {
	SchemaVersion        string             `json:"schema_version"`
	OperationID          string             `json:"operation_id"`
	CreatedAt            time.Time          `json:"created_at"`
	BundleMaxBytes       int64              `json:"bundle_max_bytes"`
	ArtifactMaxBytes     int64              `json:"artifact_max_bytes"`
	LogTailMaxBytes      int64              `json:"log_tail_max_bytes"`
	EventSummaryMaxBytes int64              `json:"event_summary_max_bytes"`
	RedactionVersion     string             `json:"redaction_version"`
	Artifacts            []ManifestArtifact `json:"artifacts"`
}

type ManifestArtifact

type ManifestArtifact struct {
	Path             string `json:"path"`
	Included         bool   `json:"included"`
	OmittedReason    string `json:"omitted_reason,omitempty"`
	Bytes            int64  `json:"bytes"`
	Truncated        bool   `json:"truncated"`
	RedactionVersion string `json:"redaction_version,omitempty"`
}

type Operation

type Operation struct {
	OperationID   string
	Status        OperationStatus
	FileName      string
	FilePath      string
	SizeBytes     int64
	Manifest      *Manifest
	FailureReason string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	CompletedAt   *time.Time
}

type OperationStatus

type OperationStatus string
const (
	OperationPending   OperationStatus = "pending"
	OperationRunning   OperationStatus = "running"
	OperationCompleted OperationStatus = "completed"
	OperationFailed    OperationStatus = "failed"
)

type Service

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

func NewService

func NewService(builder *Builder) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, req CreateRequest) (Operation, error)

func (*Service) DownloadPath

func (s *Service) DownloadPath(ctx context.Context, operationID string) (Operation, string, error)

func (*Service) Get

func (s *Service) Get(_ context.Context, operationID string) (Operation, error)

type SnapshotFunc

type SnapshotFunc func(context.Context) (any, error)

type Sources

type Sources struct {
	Status             SnapshotFunc
	Doctor             SnapshotFunc
	Providers          SnapshotFunc
	ConfigApplyRecords SnapshotFunc
	EventSummaries     SnapshotFunc
	Sessions           SnapshotFunc
}

Jump to

Keyboard shortcuts

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