paperapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInfo

type ApplicationInfo struct {
	Name   string `json:"name"`
	Sha256 string `json:"sha256"`
}

ApplicationInfo contains information about the available download, including file name, and sha256 hash

type BuildInfo

type BuildInfo struct {
	Version   string        `json:"version"`
	Channel   string        `json:"channel"`
	Downloads *DownloadInfo `json:"downloads"`
	Build     int           `json:"build"`
}

BuildInfo contains information about a specific paper build.

type BuildInfoService

type BuildInfoService interface {
	GetBuildInfo(version string, build int) (*BuildInfo, error)
}

BuildInfoService provides methods for getting build info

type BuildsList

type BuildsList struct {
	Version string `json:"version"`
	Builds  []int  `json:"builds"`
}

BuildsList contains information about the available builds made for the version

type BuildsListService

type BuildsListService interface {
	GetBuildsList(version string) (*BuildsList, error)
}

BuildsListService provides methods for getting a list of builds

type DownloadInfo

type DownloadInfo struct {
	Application *ApplicationInfo `json:"application"`
}

DownloadInfo contains information about the available downloads for a Build

type Service

type Service interface {
	GetLatestBuild(unstable bool, versionPrefix string) (*BuildInfo, error)
	IsValidDownload(filePath string, hash string) (bool, error)
	DownloadJar(buildInfo *BuildInfo, filepath string) error
	DownloadExists(filePath string, buildInfo *BuildInfo) (bool, error)
}

Service contains methods to get paper api info conveniently.

func GetPaperAPIService

func GetPaperAPIService() Service

GetPaperAPIService builds dependencies and passes them into the PaperApiServiceImpl for use

type VersionsList

type VersionsList struct {
	Versions []string `json:"versions"`
}

VersionsList contains a list of available paper versions

type VersionsListService

type VersionsListService interface {
	GetVersionsList() (*VersionsList, error)
}

VersionsListService provides methods for getting a list of versions

Jump to

Keyboard shortcuts

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