workspace

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package workspace manages the cf workspace

Index

Constants

View Source
const (
	ManifestFile   = "workspace.yaml"
	ProblemsDir    = "problems"
	TemplatesDir   = "templates"
	SubmissionsDir = "submissions"
	StatsDir       = "stats"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Workspace

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

Workspace manages a cf workspace

func New

func New(root string) *Workspace

New creates a new workspace manager

func (*Workspace) Exists

func (w *Workspace) Exists() bool

Exists checks if the workspace is initialized

func (*Workspace) GetSchemaVersion

func (w *Workspace) GetSchemaVersion() (schema.Version, error)

GetSchemaVersion returns the schema version from manifest

func (*Workspace) Init

func (w *Workspace) Init(name, handle string) error

Init initializes a new workspace

func (*Workspace) ListProblems

func (w *Workspace) ListProblems() ([]*v1.Problem, error)

ListProblems lists all problems in the workspace

func (*Workspace) Load

func (w *Workspace) Load() error

Load loads an existing workspace

func (*Workspace) LoadManifest

func (w *Workspace) LoadManifest() (*v1.Workspace, error)

LoadManifest loads the workspace manifest

func (*Workspace) LoadProblem

func (w *Workspace) LoadProblem(platform string, contestID int, index string) (*v1.Problem, error)

LoadProblem loads a problem from the workspace

func (*Workspace) LoadStatement

func (w *Workspace) LoadStatement(platform string, contestID int, index string) (string, error)

LoadStatement loads the problem statement

func (*Workspace) Manifest

func (w *Workspace) Manifest() *v1.Workspace

Manifest returns the current manifest

func (*Workspace) ManifestPath

func (w *Workspace) ManifestPath() string

ManifestPath returns the path to workspace.yaml

func (*Workspace) ProblemExists

func (w *Workspace) ProblemExists(platform string, contestID int, index string) bool

ProblemExists checks if a problem exists in the workspace

func (*Workspace) ProblemPath

func (w *Workspace) ProblemPath(platform string, contestID int, index string) string

ProblemPath returns the path for a specific problem

func (*Workspace) ProblemsPath

func (w *Workspace) ProblemsPath() string

ProblemsPath returns the problems directory path

func (*Workspace) Root

func (w *Workspace) Root() string

Root returns the workspace root path

func (*Workspace) SaveManifest

func (w *Workspace) SaveManifest() error

SaveManifest saves the workspace manifest

func (*Workspace) SaveNotes

func (w *Workspace) SaveNotes(platform string, contestID int, index string, notes *v1.UserNotes) error

SaveNotes saves user notes for a problem

func (*Workspace) SaveProblem

func (w *Workspace) SaveProblem(problem *v1.Problem) error

SaveProblem saves a problem to the workspace

func (*Workspace) SaveStatement

func (w *Workspace) SaveStatement(problem *v1.Problem, statement string) error

SaveStatement saves the problem statement as markdown

func (*Workspace) StatsPath

func (w *Workspace) StatsPath() string

StatsPath returns the stats directory path

func (*Workspace) SubmissionsPath

func (w *Workspace) SubmissionsPath() string

SubmissionsPath returns the submissions directory path

func (*Workspace) TemplatesPath

func (w *Workspace) TemplatesPath() string

TemplatesPath returns the templates directory path

func (*Workspace) UpdatePractice

func (w *Workspace) UpdatePractice(platform string, contestID int, index string, practice *v1.PracticeData) error

UpdatePractice updates practice data for a problem

func (*Workspace) Validate

func (w *Workspace) Validate() error

Validate checks the workspace integrity

Jump to

Keyboard shortcuts

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