Documentation
¶
Index ¶
- Constants
- Variables
- func CreateCurseforgeDependencies(depsInstallable []CfInstallableDep) ([]*core.Mod, error)
- func CurseforgeCategoryLookup(category string) (uint32, uint32, error)
- func CurseforgeFindMissingDependencies(pack core.Pack, fileInfoData CfModFileInfo, primaryMCVersion string) ([]*core.Mod, error)
- func CurseforgeModInfoFromID(modID uint32, fileID uint32, mcVersions []string, packLoaders []string) (CfModInfo, CfModFileInfo, error)
- func CurseforgeModInfoFromSlug(slug string, category string, fileID uint32, mcVersions []string, ...) (CfModInfo, CfModFileInfo, error)
- func CurseforgeNewMod(modInfo CfModInfo, fileInfo CfModFileInfo, optionalDisabled bool) (*core.Mod, error)
- func CurseforgeParseUrl(url string) (category string, slug string, fileID uint32, err error)
- func GetCfModType(gameID, classID, categoryID uint32) string
- func GetCurseforgeClient() *cfApiClient
- func GetCurseforgeVersion(mcVersion string) string
- func GetCurseforgeVersions(mcVersions []string) []string
- func GetModrinthClient() *modrinthApi.Client
- func GetModrinthVersionPrimaryFile(version *modrinthApi.Version, optionalFilenameMatch string) *modrinthApi.File
- func GitHubNewMod(slugOrUrl, branch, regex, modType string) (*core.Mod, error)
- func MapDepOverride(depID uint32, isQuilt bool, mcVersion string) uint32
- func ModrinthFindMissingDependencies(version *modrinthApi.Version, pack core.Pack, optionalDatapackFolder string) ([]*core.Mod, error)
- func ModrinthGetLatestVersion(projectID string, name string, pack core.Pack, optionalDatapackFolder string) (*modrinthApi.Version, error)
- func ModrinthNewMod(project *modrinthApi.Project, version *modrinthApi.Version, modType string, ...) (*core.Mod, error)
- func ModrinthProjectFromVersionID(versionId string) (*modrinthApi.Project, *modrinthApi.Version, error)
- func ModrinthSearchForProjects(query string, versions []string) ([]*modrinthApi.Project, error)
- func ParseAsModrinthSlug(input string) string
- func ParseAsModrinthVersion(input string) string
- func ParseAsModrinthVersionID(input string) string
- func ParseAsParseAsFilename(input string) string
- func ParseModrinthSlugOrUrl(input string, slug *string, version *string, versionID *string, ...) (parsedSlug bool, err error)
- func ResolveModrinthVersion(project *modrinthApi.Project, version string) (*modrinthApi.Version, error)
- type Asset
- type CfDownloadMetadata
- type CfDownloader
- type CfExportData
- type CfInstallableDep
- type CfModFileInfo
- type CfModInfo
- type CfUpdateData
- type CfUpdater
- type ModloaderType
- type ModrinthDepMetadataStore
- type ModrinthPack
- type ModrinthPackFile
- type Release
- type Repo
Constants ¶
View Source
const (
DependencyTypeRequired dependencyType
)
noinspection GoUnusedConst
View Source
const (
GameApiStatusPublic gameApiStatus
)
noinspection GoUnusedConst
View Source
const (
GameStatusLive gameStatus
)
noinspection GoUnusedConst
Variables ¶
View Source
var GithubRegex = regexp.MustCompile(`^https?://(?:www\.)?github\.com/([^/]+/[^/]+)`)
View Source
var ModloaderIds = [...]string{
"",
"forge",
"cauldron",
"liteloader",
"fabric",
"quilt",
"neoforge",
}
View Source
var ModloaderNames = [...]string{
"",
"Forge",
"Cauldron",
"Liteloader",
"Fabric",
"Quilt",
"NeoForge",
}
Functions ¶
func CreateCurseforgeDependencies ¶
func CreateCurseforgeDependencies(depsInstallable []CfInstallableDep) ([]*core.Mod, error)
func CurseforgeModInfoFromID ¶
func CurseforgeModInfoFromSlug ¶
func CurseforgeModInfoFromSlug( slug string, category string, fileID uint32, mcVersions []string, searchLoaderType ModloaderType, packLoaders []string, ) (CfModInfo, CfModFileInfo, error)
func CurseforgeNewMod ¶
func CurseforgeParseUrl ¶
func GetCfModType ¶
func GetCurseforgeClient ¶
func GetCurseforgeClient() *cfApiClient
func GetCurseforgeVersion ¶
func GetCurseforgeVersions ¶
func GetModrinthClient ¶
func GetModrinthClient() *modrinthApi.Client
func GetModrinthVersionPrimaryFile ¶
func GetModrinthVersionPrimaryFile( version *modrinthApi.Version, optionalFilenameMatch string, ) *modrinthApi.File
func MapDepOverride ¶
MapDepOverride transforms manual dependency overrides (which will likely be removed when packwiz is able to determine provided mods)
func ModrinthNewMod ¶
func ModrinthNewMod( project *modrinthApi.Project, version *modrinthApi.Version, modType string, compatibleLoaders []string, optionalFilenameMatch string, ) (*core.Mod, error)
func ModrinthProjectFromVersionID ¶
func ModrinthProjectFromVersionID(versionId string) (*modrinthApi.Project, *modrinthApi.Version, error)
func ModrinthSearchForProjects ¶
func ModrinthSearchForProjects(query string, versions []string) ([]*modrinthApi.Project, error)
func ParseAsModrinthSlug ¶
func ParseAsModrinthVersion ¶
func ParseAsParseAsFilename ¶
func ParseModrinthSlugOrUrl ¶
func ResolveModrinthVersion ¶
func ResolveModrinthVersion(project *modrinthApi.Project, version string) (*modrinthApi.Version, error)
Types ¶
type CfDownloadMetadata ¶
type CfDownloadMetadata struct {
// contains filtered or unexported fields
}
func (*CfDownloadMetadata) DownloadFile ¶
func (m *CfDownloadMetadata) DownloadFile() (io.ReadCloser, error)
func (*CfDownloadMetadata) GetManualDownload ¶
func (m *CfDownloadMetadata) GetManualDownload() (bool, core.ManualDownload)
type CfDownloader ¶
type CfDownloader struct{}
func (CfDownloader) GetFilesMetadata ¶
func (c CfDownloader) GetFilesMetadata(mods []*core.Mod) ([]core.MetaDownloaderData, error)
type CfExportData ¶
type CfExportData struct {
ProjectID uint32 `mapstructure:"project-id"`
}
func ParseExportData ¶
func ParseExportData(from map[string]interface{}) (CfExportData, error)
func (CfExportData) ToMap ¶
func (e CfExportData) ToMap() (map[string]interface{}, error)
type CfInstallableDep ¶
type CfInstallableDep struct {
CfModInfo
FileInfo CfModFileInfo
}
type CfModFileInfo ¶
type CfModFileInfo struct {
ID uint32 `json:"id"`
ModID uint32 `json:"modId"`
FileName string `json:"fileName"`
FriendlyName string `json:"displayName"`
Date time.Time `json:"fileDate"`
Length uint64 `json:"fileLength"`
FileType fileType `json:"releaseType"`
// According to the CurseForge API T&Cs, this must not be saved or cached
DownloadURL string `json:"downloadUrl"`
GameVersions []string `json:"gameVersions"`
Fingerprint uint32 `json:"fileFingerprint"`
Dependencies []struct {
ModID uint32 `json:"modId"`
Type dependencyType `json:"relationType"`
} `json:"dependencies"`
Hashes []struct {
Value string `json:"value"`
Algorithm hashAlgo `json:"algo"`
} `json:"hashes"`
}
CfModFileInfo is a subset of the deserialised JSON response from the Curse API for mod files
func CfFindLatestFile ¶
func CfFindLatestFile(modInfoData CfModInfo, mcVersions []string, packLoaders []string) (fileID uint32, fileInfoData *CfModFileInfo, fileName string)
CfFindLatestFile looks at mod info, and finds the latest file ID (and potentially the file info for it - may be null)
func GetLatestFile ¶
func (CfModFileInfo) GetBestHash ¶
func (i CfModFileInfo) GetBestHash() (hash string, hashFormat string)
type CfModInfo ¶
type CfModInfo struct {
Name string `json:"name"`
Summary string `json:"summary"`
Slug string `json:"slug"`
ID uint32 `json:"id"`
GameID uint32 `json:"gameId"`
PrimaryCategoryID uint32 `json:"primaryCategoryId"`
ClassID uint32 `json:"classId"`
LatestFiles []CfModFileInfo `json:"latestFiles"`
GameVersionLatestFiles []struct {
// TODO: check how twitch launcher chooses which one to use, when you are on beta/alpha channel?!
// or does it not have the concept of release channels?!
GameVersion string `json:"gameVersion"`
ID uint32 `json:"fileId"`
Name string `json:"filename"`
FileType fileType `json:"releaseType"`
Modloader ModloaderType `json:"modLoader"`
} `json:"latestFilesIndexes"`
ModLoaders []string `json:"modLoaders"`
Links struct {
WebsiteURL string `json:"websiteUrl"`
} `json:"links"`
}
CfModInfo is a subset of the deserialised JSON response from the Curse API for mods (addons)
type CfUpdateData ¶
type CfUpdateData struct {
ProjectID uint32 `mapstructure:"project-id"`
FileID uint32 `mapstructure:"file-id"`
}
func (CfUpdateData) ToMap ¶
func (u CfUpdateData) ToMap() (map[string]interface{}, error)
type CfUpdater ¶
type CfUpdater struct{}
func (CfUpdater) CheckUpdate ¶
func (CfUpdater) ParseUpdate ¶
type ModloaderType ¶
type ModloaderType uint8
const ( // ModloaderTypeAny should not be passed to the API - it does not work ModloaderTypeAny ModloaderType = iota ModloaderTypeForge ModloaderTypeCauldron ModloaderTypeLiteloader ModloaderTypeFabric ModloaderTypeQuilt ModloaderTypeNeoForge )
noinspection GoUnusedConst
func CfFilterFileInfoLoaderIndex ¶
func CfFilterFileInfoLoaderIndex(packLoaders []string, fileInfoData CfModFileInfo) (ModloaderType, bool)
func CfFilterLoaderTypeIndex ¶
func CfFilterLoaderTypeIndex(packLoaders []string, modLoaderType ModloaderType) (ModloaderType, bool)
func CfGetSearchLoaderType ¶
func CfGetSearchLoaderType(pack core.Pack) ModloaderType
type ModrinthDepMetadataStore ¶
type ModrinthDepMetadataStore struct {
ProjectInfo *modrinthApi.Project
VersionInfo *modrinthApi.Version
FileInfo *modrinthApi.File
}
type ModrinthPack ¶
type ModrinthPackFile ¶
Click to show internal directories.
Click to hide internal directories.