database

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package database helps maintaining Minecraft resources available at Curse CDN

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateDatabase

func UpdateDatabase(verbose bool)

UpdateDatabase gets information from Curse CDN server and puts them in a database

Types

type Database

type Database interface {
	Packages() PkgList
	Files() FileList
}

Database interface allows to store lists of files and packages locally or remotely.

func GetDatabase

func GetDatabase() Database

GetDatabase function returns a database stored in MCPM local directory. If database doesn't exist it gets updated.

type FileElement

type FileElement struct {
	ID, PkgID       int    // File ID, Package ID
	Name, MCVersion string // File name, Minecraft version
}

FileElement contains information about file available on Curse server.

type FileList

type FileList interface {
	Get(fid int) *FileElement
}

FileList interface supplies a method of getting file information

type PkgElement

type PkgElement struct {
	ID, Type                    int
	Name, FullName, Description string
	Authors                     []string
}

PkgElement contains information about Minecraft resource (package)

type PkgList

type PkgList interface {
	Get(pid int) *PkgElement
	GetByName(pname string) *PkgElement
	Each(fn func(int, *PkgElement))
}

PkgList interface supplies methods for lists of packages

Jump to

Keyboard shortcuts

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