version

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentCardVersion    = 3
	CurrentBoardVersion   = 11
	CurrentGlobalVersion  = 2
	CurrentProjectVersion = 2
)

Current schema versions - bump these when making breaking changes.

CHECKLIST when bumping a version:

  1. Update the constant below
  2. Add entry to MinKanVersion map (tested by TestMinKanVersionCompleteness)
  3. Add testdata/migrations/vN/ fixtures (tested by TestMigrationFixturesComplete)
  4. Add migration tests in migrate_service_test.go
  5. Update COMPAT.md with migration details
View Source
const (
	BoardSchemaPrefix   = "board/"
	GlobalSchemaPrefix  = "global/"
	ProjectSchemaPrefix = "project/"
)

Schema type prefixes for config files.

Variables

View Source
var MinKanVersion = map[string]string{
	"card/1":    "0.1.0",
	"card/2":    "0.21.0",
	"card/3":    "0.25.0",
	"board/1":   "0.1.0",
	"board/2":   "0.2.0",
	"board/3":   "0.4.0",
	"board/4":   "0.5.0",
	"board/5":   "0.6.0",
	"board/6":   "0.7.0",
	"board/7":   "0.8.0",
	"board/8":   "0.9.0",
	"board/9":   "0.10.0",
	"board/10":  "0.21.0",
	"board/11":  "0.22.0",
	"global/1":  "0.1.0",
	"global/2":  "0.26.0",
	"project/1": "0.3.0",
	"project/2": "0.20.0",
}

MinKanVersion maps schema identifiers to the minimum Kan version required. Used to provide helpful upgrade messages when encountering newer schemas.

Functions

func CurrentBoardSchema

func CurrentBoardSchema() string

CurrentBoardSchema returns the current board schema string.

func CurrentGlobalSchema

func CurrentGlobalSchema() string

CurrentGlobalSchema returns the current global schema string.

func CurrentProjectSchema added in v0.8.0

func CurrentProjectSchema() string

CurrentProjectSchema returns the current project schema string.

func FormatBoardSchema

func FormatBoardSchema(v int) string

FormatBoardSchema creates a board schema string from a version number. Example: FormatBoardSchema(1) returns "board/1"

func FormatGlobalSchema

func FormatGlobalSchema(v int) string

FormatGlobalSchema creates a global schema string from a version number. Example: FormatGlobalSchema(1) returns "global/1"

func FormatProjectSchema added in v0.8.0

func FormatProjectSchema(v int) string

FormatProjectSchema creates a project schema string from a version number. Example: FormatProjectSchema(1) returns "project/1"

func InvalidBoardSchema

func InvalidBoardSchema(path, found string) error

InvalidBoardSchema creates an error for a board with an unsupported schema.

func InvalidCardVersion

func InvalidCardVersion(path string, found, expected int) error

InvalidCardVersion creates an error for a card with an unsupported version.

func InvalidGlobalSchema

func InvalidGlobalSchema(path, found string) error

InvalidGlobalSchema creates an error for a global config with unsupported schema.

func InvalidProjectSchema added in v0.8.0

func InvalidProjectSchema(path, found string) error

InvalidProjectSchema creates an error for a project config with unsupported schema.

func IsFutureBoardSchema added in v0.21.0

func IsFutureBoardSchema(schema string) bool

IsFutureBoardSchema returns true if schema represents a board version newer than this binary supports.

func IsFutureCardVersion added in v0.21.0

func IsFutureCardVersion(v int) bool

IsFutureCardVersion returns true if v is newer than this binary supports.

func IsFutureGlobalSchema added in v0.21.0

func IsFutureGlobalSchema(schema string) bool

IsFutureGlobalSchema returns true if schema represents a global version newer than this binary supports.

func MissingBoardSchema

func MissingBoardSchema(path string) error

MissingBoardSchema creates an error for a board config missing kan_schema.

func MissingCardVersion

func MissingCardVersion(path string) error

MissingCardVersion creates an error for a card file missing the _v field.

func MissingGlobalSchema

func MissingGlobalSchema(path string) error

MissingGlobalSchema creates an error for a global config missing kan_schema.

func MissingProjectSchema added in v0.8.0

func MissingProjectSchema(path string) error

MissingProjectSchema creates an error for a project config missing kan_schema.

func ParseBoardVersion

func ParseBoardVersion(schema string) (int, error)

ParseBoardVersion extracts the version number from a board schema string. Returns an error if the format is invalid.

func ParseGlobalVersion

func ParseGlobalVersion(schema string) (int, error)

ParseGlobalVersion extracts the version number from a global schema string. Returns an error if the format is invalid.

func ParseProjectVersion added in v0.8.0

func ParseProjectVersion(schema string) (int, error)

ParseProjectVersion extracts the version number from a project schema string. Returns an error if the format is invalid.

Types

type SchemaVersionError

type SchemaVersionError struct {
	FileType    string // "card", "board", "global"
	FilePath    string // Path to the problematic file
	Found       string // What was found (e.g., "missing", "2", "board/2")
	Expected    string // What was expected (e.g., "1", "board/1")
	MinRequired string // Minimum Kan version required (if upgrade needed)
}

SchemaVersionError indicates a schema version problem during file read/write.

func (*SchemaVersionError) Error

func (e *SchemaVersionError) Error() string

Jump to

Keyboard shortcuts

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