downloader

package
v0.0.0-...-fac872c Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package downloader implements a high-level interface for downloading a Factorio server and installing it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, version, sha256sum, outputDir string) error

Download downloads the specified Factorio version to the output directory. If version is "stable" or "experimental", it will download the latest stable or experimental version, respectively.

func EnsureVersion

func EnsureVersion(ctx context.Context, cfg *config.Config, log *slog.Logger) error

EnsureVersion ensures that the Factorio server is installed and up-to-date.

func GetVersionForChannel

func GetVersionForChannel(channel Channel) (string, error)

GetVersionForChannel returns the latest version of the specified channel.

func VersionIsChannel

func VersionIsChannel(version string) bool

VersionIsChannel returns true if the specified version is a channel

Types

type Channel

type Channel string

Channel is a Factorio release channel.

const (
	// ChannelStable is the stable channel.
	ChannelStable Channel = "stable"

	// ChannelExperimental is the experimental channel.
	ChannelExperimental Channel = "experimental"
)

func (Channel) String

func (c Channel) String() string

String returns the string representation of the channel.

Jump to

Keyboard shortcuts

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