Documentation ¶
Index ¶
- Constants
- Variables
- func MatchHash(data []byte, hashFormat string, hash string) (bool, error)
- type CurseClient
- type CurseforgeData
- type DLType
- type Download
- type IndexToml
- type IndexedfileToml
- type Installer
- type LocalInstaller
- type MetafileDownload
- type MetafileOption
- type MetafileToml
- type MetafileUpdate
- type Mod
- type Pack
- type PackToml
- type RepoOptFn
- type Repository
- type Side
- type UpdateCurseForge
- type UpdateModrinth
- type Updates
Constants ¶
Variables ¶
View Source
var (
DefaultCurseClient = NewCurseClient(getApiKey())
)
View Source
var PreferredHashList = []string{
"murmur2",
"md5",
"sha1",
"sha256",
"sha512",
}
Functions ¶
Types ¶
type CurseClient ¶
type CurseClient struct {
// contains filtered or unexported fields
}
func NewCurseClient ¶
func NewCurseClient(apiKey string) *CurseClient
func (*CurseClient) GetDownloadUrl ¶
func (c *CurseClient) GetDownloadUrl(ctx context.Context, d *CurseforgeData) (string, error)
type CurseforgeData ¶ added in v1.1.0
func ParseCfData ¶ added in v1.1.0
func ParseCfData(s string) (*CurseforgeData, error)
func (*CurseforgeData) String ¶ added in v1.1.0
func (d *CurseforgeData) String() string
type IndexToml ¶
type IndexToml struct { HashFormat string `toml:"hash-format"` Files []IndexedfileToml `toml:"files,omitempty"` }
type IndexedfileToml ¶
type LocalInstaller ¶ added in v1.1.0
func NewLocalInstaller ¶ added in v1.1.0
func NewLocalInstaller(p *Pack, dir string) (*LocalInstaller, error)
func (*LocalInstaller) GetUpdates ¶ added in v1.1.0
func (i *LocalInstaller) GetUpdates() (*Updates, error)
func (*LocalInstaller) Install ¶ added in v1.1.0
func (i *LocalInstaller) Install(ctx context.Context) (*Updates, error)
Install execute install and update modpack
func (*LocalInstaller) InstallMod ¶ added in v1.1.0
func (i *LocalInstaller) InstallMod(ctx context.Context, m *Mod) error
type MetafileDownload ¶ added in v1.1.0
type MetafileOption ¶ added in v1.1.0
type MetafileToml ¶
type MetafileToml struct { Filename string `toml:"filename"` Name string `toml:"name"` Side string `toml:"side,omitempty"` Download *MetafileDownload `toml:"download"` Update *MetafileUpdate `toml:"update,omitempty"` Option *MetafileOption `toml:"option,omitempty"` IndexName string }
type MetafileUpdate ¶ added in v1.1.0
type MetafileUpdate struct { Modrinth *UpdateModrinth `toml:"modrinth,omitempty,nullable"` CurseForge *UpdateCurseForge `toml:"curseforge,omitempty,nullable"` }
type Pack ¶ added in v1.1.0
type Pack struct { Name string `json:"name"` Author string `json:"author,omitempty"` Version string `json:"version,omitempty"` Mods []*Mod `json:"files,omitempty"` }
func NewPack ¶ added in v1.1.0
func NewPack(r *Repository) (*Pack, error)
type PackToml ¶
type PackToml struct { Name string `toml:"name"` Author string `toml:"author,omitempty"` Version string `toml:"version,omitempty"` Description string `toml:"description,omitempty"` PackFormat string `toml:"pack-format"` Index struct { File string `toml:"file"` HashFormat string `toml:"hash-format"` Hash string `toml:"hash"` } `toml:"index"` Versions map[string]string `toml:"versions"` }
type RepoOptFn ¶
type RepoOptFn func(r *Repository)
type Repository ¶
type Repository struct { Url *url.URL Pack *PackToml Index *IndexToml Metafiles []*MetafileToml PackHashFormat string PackHash string // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(url *url.URL, hashFormat, hash string) *Repository
func (*Repository) BaseUrl ¶
func (r *Repository) BaseUrl() *url.URL
func (*Repository) IndexUrl ¶
func (r *Repository) IndexUrl() *url.URL
type UpdateCurseForge ¶ added in v1.0.2
type UpdateModrinth ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.