utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloadPage          = "https://www.minecraft.net/en-us/download/server/bedrock"
	ReleaseDownloadPrefix = "https://minecraft.azureedge.net/bin-win/bedrock-server-"
	ReleaseDownloadSuffix = ".zip"
	PreviewDownloadPrefix = "https://minecraft.azureedge.net/bin-win-preview/bedrock-server-"
	PreviewDownloadSuffix = ".zip"
)

Variables

This section is empty.

Functions

func CheckCache

func CheckCache(version string, cacheDir string) (string, error)

func DownloadFile

func DownloadFile(uri string, bar *progressbar.ProgressBar) (string, error)

DownloadFile downloads a file from the given uri and returns the file name. If bar is not nil, the progress will be written to it.

func DownloadVersion

func DownloadVersion(version string, isPreview bool) (string, error)

DownloadVersion downloads the given version of BDS.

func GetLatestPreviewVersion

func GetLatestPreviewVersion() (string, error)

GetLatestPreviewVersion returns the latest preview version of BDS.

func GetLatestReleaseVersion

func GetLatestReleaseVersion() (string, error)

GetLatestReleaseVersion returns the latest version of BDS.

func Install

func Install() error

Install installs the given version of BDS.

func SetConfig

func SetConfig(config Config)

func SetTargetVersion

func SetTargetVersion(version string)

func Unzip

func Unzip(zipFile *os.File, bar *progressbar.ProgressBar) error

Unzip zip file to the current directory.

Types

type Config

type Config struct {
	UsePreview    bool
	SkipAgree     bool
	ClearCache    bool
	UseCache      bool
	CacheDir      string
	TargetVersion string
	ExcludedFiles []string
}

func GetConfig

func GetConfig() Config

Jump to

Keyboard shortcuts

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