workspacejournal

package
v1.20.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion          = 1
	DefaultMaxBytes        = 5 * 1024 * 1024
	DefaultMaxSegmentBytes = 512 * 1024
	DefaultLimit           = 100
	MaxLimit               = 1000
)

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() (string, error)

Types

type Event

type Event struct {
	SchemaVersion     int               `json:"schemaVersion"`
	Timestamp         time.Time         `json:"timestamp"`
	WorkspaceID       string            `json:"workspaceId,omitempty"`
	Pipeline          status.Pipeline   `json:"pipeline"`
	OperationID       string            `json:"operationId,omitempty"`
	ParentOperationID string            `json:"parentOperationId,omitempty"`
	Phase             status.Phase      `json:"phase"`
	Step              string            `json:"step,omitempty"`
	State             status.State      `json:"state"`
	DurationMillis    int64             `json:"durationMillis,omitempty"`
	Error             *status.ErrorInfo `json:"error,omitempty"`
}

func Last

func Last(dir, workspaceID string) (*Event, error)

func Read

func Read(dir, workspaceID string, limit int) ([]Event, error)

type Journal

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

func New

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

func OpenDefault

func OpenDefault() (*Journal, error)

func (*Journal) Append

func (j *Journal) Append(workspaceID string, e status.Event) error

func (*Journal) Reporter

func (j *Journal) Reporter(workspaceID string) status.Reporter

type Options

type Options struct {
	Dir                       string
	MaxBytes, MaxSegmentBytes int
	Now                       func() time.Time
	Env                       []string
}

Jump to

Keyboard shortcuts

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