coremdl

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package coremdl models used throughout the mcman project, both frontend and backend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	VersionID string         `json:"versionId"`
	SiteModID string         `json:"siteModId"`
	Type      DependencyType `json:"type"`
	SiteType  SiteType       `json:"siteType"`
	Mod       *Mod           `json:"mod,omitempty"`
}

type DependencyType

type DependencyType string
const (
	DependencyTypeRequired     DependencyType = "required"
	DependencyTypeOptional     DependencyType = "optional"
	DependencyTypeIncompatible DependencyType = "incompatible"
	DependencyTypeUnknown      DependencyType = "unknown"
)

type File

type File struct {
	Filename    string `json:"filename"`
	DownloadURL string `json:"downloadUrl"`
	Size        int    `json:"size"`
}

type JarInfo

type JarInfo struct {
	NameID        string    `json:"nameId"`
	ModLoaders    ModLoader `json:"modLoaders"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	VersionNumber string    `json:"version"`
}

type MCVersion

type MCVersion string

func (MCVersion) IsSet

func (v MCVersion) IsSet() bool

func (MCVersion) String

func (v MCVersion) String() string

type MCVersions

type MCVersions []MCVersion

func (MCVersions) Contains

func (v MCVersions) Contains(version MCVersion) bool

type Mod

type Mod struct {
	ID        string    `json:"id" firestore:"id"`
	NameID    string    `json:"nameId" firestore:"nameId"`
	Sites     ModSites  `json:"sites" firestore:"sites"`
	Timestamp time.Time `json:"timestamp" firestore:"timestamp"`
}

Mod contains internal ID including information about the mod on different sites.

type ModLoader

type ModLoader uint32
const (
	// ModLoaderNone is the default value for a mod loader
	ModLoaderNone    ModLoader = 0
	ModLoaderUnknown ModLoader = 1 << iota
	ModLoaderFabric
	ModLoaderForge
	ModLoaderQuilt
	ModLoaderBukkit
	ModLoaderSponge
	ModLoaderSpigot
	ModLoaderPaper
)

func NewModLoaderFromString

func NewModLoaderFromString(s string) ModLoader

func (ModLoader) Has

func (m ModLoader) Has(other ModLoader) bool

func (ModLoader) String

func (m ModLoader) String() string

type ModSite

type ModSite struct {
	ID          string     `json:"id" firestore:"id"`
	Name        string     `json:"name" firestore:"name"`
	Type        SiteType   `json:"type" firestore:"type"`
	Slug        string     `json:"slug" firestore:"slug"`
	Description string     `json:"description" firestore:"description"`
	ModLoaders  ModLoader  `json:"modLoaders" firestore:"modLoaders"`
	MCVersions  MCVersions `json:"mcVersions" firestore:"mcVersions"`
	Updated     time.Time  `json:"updated" firestore:"updated"`
	Published   time.Time  `json:"published" firestore:"published"`
	Timestamp   time.Time  `json:"timestamp" firestore:"timestamp"` // Timestamp when this information was updated in DB
}

ModSite mod information for a specific site

func (ModSite) HasModLoader

func (m ModSite) HasModLoader(modLoader ModLoader) bool

HasModLoader returns true if the mod has the specified mod loader Will also return true if the mod loader is none in the mod site or parameter

type ModSites

type ModSites []ModSite

ModSites map of mod sites

func (ModSites) GetType

func (m ModSites) GetType(Type SiteType) (int, *ModSite)

type SiteType

type SiteType string

SiteType Where the mod can be found

const (
	SiteTypeCurse    SiteType = "curse"
	SiteTypeModrinth SiteType = "modrinth"
)

type Stability

type Stability string
const (
	StabilityAlpha   Stability = "alpha"
	StabilityBeta    Stability = "beta"
	StabilityRelease Stability = "release"
	StabilityUnknown Stability = "unknown"
)

type Version

type Version struct {
	SiteVersionID string       `json:"siteVersionId" firestore:"siteVersionId"`
	ModID         string       `json:"modId" firestore:"modId"`
	SiteModID     string       `json:"siteModId" firestore:"siteModId"`
	Number        string       `json:"number" firestore:"number"`
	Stability     Stability    `json:"stability" firestore:"stability"`
	SiteType      SiteType     `json:"siteType" firestore:"siteType"`
	UploadTime    time.Time    `json:"uploadTime" firestore:"uploadTime"`
	MCVersions    MCVersions   `json:"minecraftVersions" firestore:"minecraftVersions"`
	File          File         `json:"file" firestore:"file"`
	ModLoader     ModLoader    `json:"modLoader" firestore:"modLoader"`
	Dependencies  []Dependency `json:"dependencies" firestore:"dependencies"`
	Timestamp     time.Time    `json:"timestamp" firestore:"timestamp"`
}

Directories

Path Synopsis
Package status various server status code containing more information why the request failed.
Package status various server status code containing more information why the request failed.

Jump to

Keyboard shortcuts

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