r2modman

package
v0.0.0-...-e3a4ae0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package r2modman contains utilities for interacting with r2modman/thunderstore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPackagesMetadata

func GetPackagesMetadata(ctx context.Context, metadataUrl string) (packages map[string]*APIPackageResponse, err error)

func Module

func Module(c Config) fx.Option

Types

type APIPackageResponse

type APIPackageResponse struct {
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	Versions []struct {
		Name     string `json:"name"`
		FullName string `json:"full_name"`
		FileSize int64  `json:"file_size"`
	} `json:"versions"`
}

type Config

type Config struct {
	InstallDirectory          string
	WorkDirectory             string
	ThunderstoreForceDownload bool
	ThunderstoreCDN           string
	ThunderstoreCDNTimeout    time.Duration
}

type ExportParser

type ExportParser interface {
	Parse(file string) (*ExportR2x, error)
}

type ExportR2x

type ExportR2x struct {
	ProfileName string `yaml:"profileName"`
	Mods        []ExportR2xMod
}

type ExportR2xMod

type ExportR2xMod struct {
	Name    string
	Version ExportR2xModVersion
	Enabled bool
}

func (*ExportR2xMod) DownloadUrl

func (e *ExportR2xMod) DownloadUrl(cdnHost string) string

func (ExportR2xMod) Filename

func (e ExportR2xMod) Filename() string

func (*ExportR2xMod) ThunderstoreKey

func (e *ExportR2xMod) ThunderstoreKey() string

func (*ExportR2xMod) ThunderstoreModVersion

func (e *ExportR2xMod) ThunderstoreModVersion() string

type ExportR2xModVersion

type ExportR2xModVersion struct {
	Major int
	Minor int
	Patch int
}

type ModPackagingType

type ModPackagingType int
const (
	// ModPackagingTypeUnknown is the default packaging type. This means the packaging is unrecognized
	ModPackagingTypeUnknown ModPackagingType = iota
	ModPackagingTypeRoot
	ModPackagingTypePlugin
	ModPackagingTypeRootDLL
)

func DeterminePackagingType

func DeterminePackagingType(modZipFilename string) (modType ModPackagingType, prefixToStrip string, err error)

func (ModPackagingType) Directory

func (d ModPackagingType) Directory() string

func (ModPackagingType) String

func (d ModPackagingType) String() string

type ModUtil

type ModUtil interface {
	Download(mod ExportR2xMod, metadata *APIPackageResponse) error
}

Jump to

Keyboard shortcuts

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