Documentation
¶
Index ¶
- Constants
- Variables
- func CurrentBoardSchema() string
- func CurrentGlobalSchema() string
- func CurrentProjectSchema() string
- func FormatBoardSchema(v int) string
- func FormatGlobalSchema(v int) string
- func FormatProjectSchema(v int) string
- func InvalidBoardSchema(path, found string) error
- func InvalidCardVersion(path string, found, expected int) error
- func InvalidGlobalSchema(path, found string) error
- func InvalidProjectSchema(path, found string) error
- func IsFutureBoardSchema(schema string) bool
- func IsFutureCardVersion(v int) bool
- func IsFutureGlobalSchema(schema string) bool
- func MissingBoardSchema(path string) error
- func MissingCardVersion(path string) error
- func MissingGlobalSchema(path string) error
- func MissingProjectSchema(path string) error
- func ParseBoardVersion(schema string) (int, error)
- func ParseGlobalVersion(schema string) (int, error)
- func ParseProjectVersion(schema string) (int, error)
- type SchemaVersionError
Constants ¶
const ( CurrentCardVersion = 3 CurrentBoardVersion = 11 CurrentGlobalVersion = 2 CurrentProjectVersion = 2 )
Current schema versions - bump these when making breaking changes.
CHECKLIST when bumping a version:
- Update the constant below
- Add entry to MinKanVersion map (tested by TestMinKanVersionCompleteness)
- Add testdata/migrations/vN/ fixtures (tested by TestMigrationFixturesComplete)
- Add migration tests in migrate_service_test.go
- Update COMPAT.md with migration details
const ( BoardSchemaPrefix = "board/" GlobalSchemaPrefix = "global/" ProjectSchemaPrefix = "project/" )
Schema type prefixes for config files.
Variables ¶
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 ¶
FormatBoardSchema creates a board schema string from a version number. Example: FormatBoardSchema(1) returns "board/1"
func FormatGlobalSchema ¶
FormatGlobalSchema creates a global schema string from a version number. Example: FormatGlobalSchema(1) returns "global/1"
func FormatProjectSchema ¶ added in v0.8.0
FormatProjectSchema creates a project schema string from a version number. Example: FormatProjectSchema(1) returns "project/1"
func InvalidBoardSchema ¶
InvalidBoardSchema creates an error for a board with an unsupported schema.
func InvalidCardVersion ¶
InvalidCardVersion creates an error for a card with an unsupported version.
func InvalidGlobalSchema ¶
InvalidGlobalSchema creates an error for a global config with unsupported schema.
func InvalidProjectSchema ¶ added in v0.8.0
InvalidProjectSchema creates an error for a project config with unsupported schema.
func IsFutureBoardSchema ¶ added in v0.21.0
IsFutureBoardSchema returns true if schema represents a board version newer than this binary supports.
func IsFutureCardVersion ¶ added in v0.21.0
IsFutureCardVersion returns true if v is newer than this binary supports.
func IsFutureGlobalSchema ¶ added in v0.21.0
IsFutureGlobalSchema returns true if schema represents a global version newer than this binary supports.
func MissingBoardSchema ¶
MissingBoardSchema creates an error for a board config missing kan_schema.
func MissingCardVersion ¶
MissingCardVersion creates an error for a card file missing the _v field.
func MissingGlobalSchema ¶
MissingGlobalSchema creates an error for a global config missing kan_schema.
func MissingProjectSchema ¶ added in v0.8.0
MissingProjectSchema creates an error for a project config missing kan_schema.
func ParseBoardVersion ¶
ParseBoardVersion extracts the version number from a board schema string. Returns an error if the format is invalid.
func ParseGlobalVersion ¶
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
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