itemupgrader

package
v1.99.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSchema

func RegisterSchema(r io.Reader) error

RegisterSchema attempts to decode and parse a schema from the provided file reader. The file must follow the correct specification otherwise an error will be returned.

Types

type Item

type Item interface {
	// contains filtered or unexported methods
}

Item holds the data that identifies an item. It is implemented by ItemMeta.

type ItemMeta

type ItemMeta struct {
	Name string
	Meta int16
}

ItemMeta holds the name and meta values of an item.

func Upgrade

func Upgrade(b Item) ItemMeta

Upgrade upgrades the given item using the registered item upgrade schemas. If an Item has not been changed through several versions, Upgrade will simply return the original value. Calling itemupgrader.Upgrade is therefore safe regardless of whether the item is already up-to-date or not.

func UpgradeToVersion

func UpgradeToVersion(b Item, targetVersion string) ItemMeta

UpgradeToVersion upgrades the given item up to targetVersion. If there is no schema for targetVersion, the closest older schema version is used.

Jump to

Keyboard shortcuts

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