taskzip

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInteractive = errors.New("interactive TaskZip is unsupported")
	ErrAttached    = errors.New("attached TaskZip files are unsupported")
)

Functions

func Write

func Write(task Task) ([]byte, error)

Types

type Example

type Example struct {
	Input  []byte
	Output []byte
	Notes  map[string][]byte
}

type Metadata

type Metadata struct {
	Topics         []string
	Techniques     []string
	DataStructures []string
	Difficulty     *uint8
}

type Origin

type Origin struct {
	Olymp       string
	Year        *int
	Stage       string
	Divisions   []string
	Org         string
	Authors     []string
	Lang        string
	Contestants *uint32
	Solvers     *uint32
}

type Solution

type Solution struct {
	Filename string
	Subtasks []uint32
	Score    *uint32
	Data     []byte
}

type Subtask

type Subtask struct {
	Points       *uint32
	Tests        string
	Groups       string
	VisibleInput bool
	Description  map[string]string
}

type Task

type Task struct {
	Version         uint32
	ID              string
	Name            map[string]string
	Testing         Testing
	Readme          []byte
	Statements      map[string][]byte
	StatementImages map[string][]byte
	Examples        []Example
	Tests           []Test
	Checker         []byte
	Solutions       []Solution
	Subtasks        []Subtask
	TestGroups      []TestGroup
	Origin          *Origin
	Metadata        *Metadata
	Extensions      map[string]any
}

func Read

func Read(data []byte) (Task, error)

type Test

type Test struct {
	Input  []byte
	Output []byte
}

type TestGroup

type TestGroup struct {
	ID     uint32
	First  uint32
	Last   uint32
	Points uint32
	Public bool
}

type Testing

type Testing struct {
	Type   string `toml:"type"`
	CPUMs  uint32 `toml:"cpu_ms"`
	MemMiB uint32 `toml:"mem_mib"`
}

Jump to

Keyboard shortcuts

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