Documentation ¶
Index ¶
Constants ¶
const ( // FileProvider is an update provider that simply downloads a given file. FileProvider = "FILE" // PaperProvider is an update provider that downloads the server jar from PaperMC. PaperProvider = "PAPER" )
Variables ¶
var ErrAlreadyUpToDate = errors.New("paper version is already at the latest build")
ErrAErrAlreadyUpToDate is an error returned when the server is already at the latest build for the given version.
Functions ¶
func DownloadFile ¶
DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.
Types ¶
type File ¶
type File struct {
URL string
}
File is an update provider that downloads a new server version from a given URL.
type Paper ¶
type Paper struct {
Version string
}
Paper is an update provider that downloads a new Paper server version.
type PaperApplication ¶
PaperApplication holds the name and hash of a file for a Paper build.
type PaperBuild ¶
type PaperBuild struct { Build int `json:"build"` Download PaperDownload `json:"downloads"` Version string `json:"version"` }
PaperBuild holds the API response data for a particular Paper build.
func Load ¶ added in v1.3.0
func Load(path string) (*PaperBuild, error)
Load reads saved version information from a file. If the file does not exist, this function returns an empty struct and no error.
func (PaperBuild) Save ¶ added in v1.3.0
func (p PaperBuild) Save(path string) error
Save write a Paper build to a file on disk.
type PaperBuilds ¶
type PaperBuilds struct {
Builds []int `json:"builds"`
}
PaperBuilds is the representation of the Paper API response for a version.
type PaperDownload ¶
type PaperDownload struct {
Application PaperApplication `json:"application"`
}
PaperDownload contains information about a build's file.
type PaperVersions ¶
type PaperVersions struct { VersionGroups []string `json:"version_groups"` Versions []string `json:"versions"` }
PaperVersions is the representation of all Paper versions returned by the API.