Documentation
¶
Index ¶
- Variables
- type Account
- type AccountConfig
- type AccountSecrets
- type Auth
- type Config
- type FabricModMetadata
- type Instance
- type InstanceConfig
- type InstanceConfigMod
- type InstanceLock
- type Launcher
- func (l *Launcher) AccountsDir() string
- func (l *Launcher) AssetsDir() string
- func (l *Launcher) AuthenticateAccount(account *Account) (*Auth, error)
- func (l *Launcher) ConfigPath() string
- func (l *Launcher) CreateCommand(ctx context.Context, instance *Instance, auth *Auth) (*exec.Cmd, error)
- func (l *Launcher) CreateInstance(name string, loader string, version *vanilla.Version) (*Instance, error)
- func (l *Launcher) CreateInstanceEx(name string, loader string, version *vanilla.Version, ...) (*Instance, error)
- func (l *Launcher) CreateLaunch(instance *Instance) *metadata.Launch
- func (l *Launcher) CreateOfflineAccount(username string) (*Account, error)
- func (l *Launcher) CreateOnlineAccount(auth Auth, config *AccountConfig) (*Account, error)
- func (l *Launcher) DeleteAccount(name string) error
- func (l *Launcher) DeleteInstance(name string) error
- func (l *Launcher) Download(ctx context.Context, url string, size int, wantSha1 string) (string, error)
- func (l *Launcher) DownloadAssets(ctx context.Context, instance *Instance, reporter ProgressReporter) error
- func (l *Launcher) DownloadLibraries(ctx context.Context, instance *Instance, progress ProgressReporter) error
- func (l *Launcher) EditInstance(instance *Instance, editFn func(config *InstanceConfig) error) error
- func (l *Launcher) ExtractNatives(instance *Instance) error
- func (l *Launcher) GetAccount(name string) (*Account, error)
- func (l *Launcher) GetAccounts() ([]*LoadAccountResult, error)
- func (l *Launcher) GetDefaultAccount() (*Account, error)
- func (l *Launcher) GetInstance(name string) (*Instance, error)
- func (l *Launcher) GetInstanceName(instance *Instance) string
- func (l *Launcher) GetInstances() ([]*LoadInstanceResult, error)
- func (l *Launcher) GetManifest() (*vanilla.Manifest, error)
- func (l *Launcher) GetMods(instance *Instance, preferredLoader ModLoaderType) ([]ModMetadata, error)
- func (l *Launcher) GetVersion(ctx context.Context, id string) (*vanilla.Version, error)
- func (l *Launcher) Initialize() error
- func (l *Launcher) InstancesDir() string
- func (l *Launcher) LibrariesDir() string
- func (l *Launcher) LoadInstance(ctx context.Context, name string) (*Instance, error)
- func (l *Launcher) MetaDir() string
- func (l *Launcher) Mktemp(pattern string) (*os.File, string, error)
- func (l *Launcher) PistonMetaIndexPath() string
- func (l *Launcher) PistonMetaVersionPath(id string) string
- func (l *Launcher) RenameInstance(oldName string, newName string) error
- func (l *Launcher) StartInstance(ctx context.Context, instance *Instance, auth *Auth) error
- func (l *Launcher) TmpDir() string
- func (l *Launcher) UpdateManifest(ctx context.Context) (*vanilla.Manifest, error)
- type LoadAccountResult
- type LoadInstanceResult
- type ModLoader
- type ModLoaderType
- type ModMetadata
- type NopReporter
- type ProgressReporter
- type QuiltModMetadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountNotExist = errors.New("no such account") ErrNoDefaultAccount = errors.New("no default account") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Username string `json:"username"`
Uuid string `json:"uuid"`
Xuid string `json:"xuid"`
Secrets *AccountSecrets `json:"secrets,omitempty"`
}
type AccountConfig ¶
type AccountConfig struct {
}
type AccountSecrets ¶
type AccountSecrets struct {
Scheme string `json:"scheme"`
Data string `json:"data"`
Params json.RawMessage `json:"params,omitempty"`
}
func AccountPlain ¶
func AccountPlain(token string) *AccountSecrets
type FabricModMetadata ¶
type FabricModMetadata struct {
SchemaVersion int `json:"schemaVersion"`
ID string `json:"id"`
Version string `json:"version"`
Name string `json:"name,omitempty"`
}
https://wiki.fabricmc.net/documentation:fabric_mod_json
func (*FabricModMetadata) ModID ¶
func (meta *FabricModMetadata) ModID() string
func (*FabricModMetadata) ModLoader ¶
func (meta *FabricModMetadata) ModLoader() ModLoaderType
func (*FabricModMetadata) ModVersion ¶
func (meta *FabricModMetadata) ModVersion() string
type Instance ¶
type Instance struct {
Dir string
Config InstanceConfig
ManifestVersion *vanilla.Version
}
type InstanceConfig ¶
type InstanceConfig struct {
Version string `toml:"version"`
ModLoader *ModLoader `toml:"mod-loader"`
JavaPath string `toml:"java-path"`
JvmArgs []string `toml:"jvm-args"`
AdditionalClasspath []string `toml:"additional-classpath"`
Account string `toml:"account"`
Mods map[string]InstanceConfigMod `toml:"mods"`
}
An InstanceConfig is similar to `package.toml` in npm or `Cargo.toml` in cargo. It describes what is considered compatible with a given instance.
func (*InstanceConfig) Clone ¶
func (config *InstanceConfig) Clone() *InstanceConfig
type InstanceConfigMod ¶
type InstanceConfigMod struct {
Version string `toml:"version"`
}
type InstanceLock ¶
type InstanceLock struct {
}
An InstanceLock is similar to `package-lock.json` in npm or `Cargo.lock` in cargo. It describes a fully resolved instance and may be used to reproduce an instance from scratch.
type Launcher ¶
type Launcher struct {
Version string
HttpClient *http.Client
BaseDir string
LibraryJobs uint
AssetJobs uint
Modrinth modrinth.Client
Offline bool
}
func (*Launcher) AccountsDir ¶
func (*Launcher) AuthenticateAccount ¶
func (*Launcher) ConfigPath ¶
func (*Launcher) CreateCommand ¶
func (*Launcher) CreateInstance ¶
func (*Launcher) CreateInstanceEx ¶
func (*Launcher) CreateLaunch ¶
func (*Launcher) CreateOfflineAccount ¶
func (*Launcher) CreateOnlineAccount ¶
func (l *Launcher) CreateOnlineAccount(auth Auth, config *AccountConfig) (*Account, error)
func (*Launcher) DeleteAccount ¶
func (*Launcher) DeleteInstance ¶
func (*Launcher) DownloadAssets ¶
func (*Launcher) DownloadLibraries ¶
func (*Launcher) EditInstance ¶
func (l *Launcher) EditInstance(instance *Instance, editFn func(config *InstanceConfig) error) error
func (*Launcher) ExtractNatives ¶
func (*Launcher) GetAccounts ¶
func (l *Launcher) GetAccounts() ([]*LoadAccountResult, error)
func (*Launcher) GetDefaultAccount ¶
func (*Launcher) GetInstanceName ¶
func (*Launcher) GetInstances ¶
func (l *Launcher) GetInstances() ([]*LoadInstanceResult, error)
func (*Launcher) GetMods ¶
func (l *Launcher) GetMods(instance *Instance, preferredLoader ModLoaderType) ([]ModMetadata, error)
func (*Launcher) GetVersion ¶
func (*Launcher) Initialize ¶
func (*Launcher) InstancesDir ¶
func (*Launcher) LibrariesDir ¶
func (*Launcher) LoadInstance ¶
func (*Launcher) PistonMetaIndexPath ¶
func (*Launcher) PistonMetaVersionPath ¶
func (*Launcher) RenameInstance ¶
func (*Launcher) StartInstance ¶
type LoadAccountResult ¶
type LoadInstanceResult ¶
type LoadInstanceResult struct {
Path string
Instance InstanceConfig
Error error
}
type ModLoader ¶
type ModLoader struct {
Type ModLoaderType `toml:"type"`
Version string `toml:"version"`
}
type ModLoaderType ¶
type ModLoaderType string
const ( LoaderNone ModLoaderType = "" LoaderFabric ModLoaderType = "fabric" LoaderQuilt ModLoaderType = "quilt" )
func (ModLoaderType) GetMetadata ¶
func (loader ModLoaderType) GetMetadata(root fs.FS) (ModMetadata, error)
func (*ModLoaderType) MarshalText ¶
func (loader *ModLoaderType) MarshalText() ([]byte, error)
func (*ModLoaderType) UnmarshalText ¶
func (loader *ModLoaderType) UnmarshalText(text []byte) error
type ModMetadata ¶
type ModMetadata interface {
ModLoader() ModLoaderType
ModID() string
ModVersion() string
}
type NopReporter ¶
type NopReporter struct{}
func (NopReporter) End ¶
func (NopReporter) End()
func (NopReporter) Increment ¶
func (NopReporter) Increment()
func (NopReporter) Start ¶
func (NopReporter) Start(string, int)
type ProgressReporter ¶
type QuiltModMetadata ¶
type QuiltModMetadata struct {
SchemaVersion int `json:"schema_version"`
QuiltLoader struct {
Group string `json:"group"`
ID string `json:"id"`
Version string `json:"version"`
} `json:"quilt_loader"`
}
https://wiki.quiltmc.org/en/introduction/setting-up#making-the-mod-yours
func (*QuiltModMetadata) ModId ¶
func (meta *QuiltModMetadata) ModId() string
func (*QuiltModMetadata) ModLoader ¶
func (meta *QuiltModMetadata) ModLoader() ModLoaderType
func (*QuiltModMetadata) ModVersion ¶
func (meta *QuiltModMetadata) ModVersion() string
Click to show internal directories.
Click to hide internal directories.