installer

package
v0.0.0-...-61ea175 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Windows = "windows"
	Linux   = "linux"
	OSX     = "darwin"
)

os installer type

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GameVersion string       `json:"minecraft_version"`
	Forge       ConfigForge  `json:"forge"`
	Server      ConfigServer `json:"server"`
	FTP         ConfigFTP    `json:"ftp"`
}

Config json to installer

type ConfigFTP

type ConfigFTP struct {
	URL      string `json:"url"`
	Login    string `json:"login"`
	Password string `json:"password"`
}

ConfigFTP json

type ConfigForge

type ConfigForge struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

ConfigForge json

type ConfigServer

type ConfigServer struct {
	Name string `json:"name"`
	IP   string `json:"ip"`
}

ConfigServer json

type Installer

type Installer interface {
	Close() error
	UpdateLocation(location string) error
	MinecraftPath() Path
	ForgePath() Path
	Install() error

	ForgeVersion() string
	GameVersion() string
}

Installer minecraft mods

func New

func New() (Installer, error)

New parse the config_installer.json file and create a new installer

func NewWithConfig

func NewWithConfig(conf Config) (Installer, error)

NewWithConfig statement of installer. Need to call the Close method

type LauncherProfile

type LauncherProfile struct {
	Profiles map[string]Profile `json:"profiles"`
}

LauncherProfile json data

type Path

type Path struct {
	Value string
	Valid bool
}

Path type define a disk location and valid is true if location exist

func (*Path) Update

func (p *Path) Update(path string) error

Update record the path parameter and test if is it valid.

type Profile

type Profile struct {
	Icon      string    `json:"icon"`
	LastUsed  time.Time `json:"lastUsed"`
	VersionID string    `json:"lastVersionId"`
	Type      string    `json:"type"`
	Name      string    `json:"name"`
}

Profile json data

Jump to

Keyboard shortcuts

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