Documentation
¶
Index ¶
- Constants
- func CreateFile(path string) (*os.File, error)
- func ExportPack(pack core.Pack, fileName string, targetPath string) error
- func GetPackwizCache() (string, error)
- func GetPackwizInstallBinFile() (string, error)
- func GetPackwizInstallBinPath() (string, error)
- func GetPackwizLocalCache() (string, error)
- func GetPackwizLocalStore() (string, error)
- func InitIndexFile(pack core.PackToml) error
- func LoadAll(packPath string) (*core.Pack, error)
- func LoadAllMods(index *core.IndexFS) ([]*core.ModToml, error)
- func LoadIndex(indexFile string) (core.IndexFS, error)
- func LoadMod(modFile string) (core.ModToml, error)
- func LoadPackFile(packPath string) (core.PackToml, error)
- func LoadPackIndexFile(pack *core.PackToml) (core.IndexFS, error)
- func RefreshIndexFiles(index *core.IndexFS) error
- func UpdateIndexFile(in *core.IndexFS, path string) error
- func WriteAll(pack core.Pack, targetDir string) error
- func WritePackAndIndex(pack core.Pack, targetDir string) error
- type CacheIndex
- func (c *CacheIndex) GetHandleFromHash(hashFormat string, hash string) *CacheIndexHandle
- func (c *CacheIndex) GetHandleFromHashForce(hashFormat string, hash string) (*CacheIndexHandle, error)
- func (c *CacheIndex) MoveImportFiles() error
- func (c *CacheIndex) NewHandleFromHashes(hashes map[string]string) (*CacheIndexHandle, bool)
- type CacheIndexHandle
- func (h *CacheIndexHandle) CreateFromTemp(temp *os.File) (*os.File, error)
- func (h *CacheIndexHandle) GetRemainingHashes(hashesToObtain []string) []string
- func (h *CacheIndexHandle) Open() (*os.File, error)
- func (h *CacheIndexHandle) Path() string
- func (h *CacheIndexHandle) Remove()
- func (h *CacheIndexHandle) UpdateIndex() (warnings []error)
- type CompletedDownload
- type DownloadSession
- type IndexWriter
- type ModWriter
- type PackWriter
- type Writable
Constants ¶
View Source
const DownloadCacheImportFolder = "import"
Variables ¶
This section is empty.
Functions ¶
func GetPackwizCache ¶
func GetPackwizLocalCache ¶
func GetPackwizLocalStore ¶
func InitIndexFile ¶
func LoadPackFile ¶
LoadPackFile loads the modpack metadata to a PackToml struct
func RefreshIndexFiles ¶
RefreshIndexFiles updates the hashes of all the files in the index, and adds new files to the index
Types ¶
type CacheIndex ¶
type CacheIndex struct { Version uint32 Hashes map[string][]string // contains filtered or unexported fields }
func (*CacheIndex) GetHandleFromHash ¶
func (c *CacheIndex) GetHandleFromHash(hashFormat string, hash string) *CacheIndexHandle
func (*CacheIndex) GetHandleFromHashForce ¶
func (c *CacheIndex) GetHandleFromHashForce(hashFormat string, hash string) (*CacheIndexHandle, error)
GetHandleFromHashForce looks up the given hash in the index; but will rehash any file without this hash format to obtain the necessary hash. Only use this for manually downloaded files, as it can rehash every file in the cache, which can be more time-consuming than just redownloading the file and noticing it is already in the index!
func (*CacheIndex) MoveImportFiles ¶
func (c *CacheIndex) MoveImportFiles() error
func (*CacheIndex) NewHandleFromHashes ¶
func (c *CacheIndex) NewHandleFromHashes(hashes map[string]string) (*CacheIndexHandle, bool)
type CacheIndexHandle ¶
func (*CacheIndexHandle) CreateFromTemp ¶
func (*CacheIndexHandle) GetRemainingHashes ¶
func (h *CacheIndexHandle) GetRemainingHashes(hashesToObtain []string) []string
func (*CacheIndexHandle) Path ¶
func (h *CacheIndexHandle) Path() string
func (*CacheIndexHandle) Remove ¶
func (h *CacheIndexHandle) Remove()
func (*CacheIndexHandle) UpdateIndex ¶
func (h *CacheIndexHandle) UpdateIndex() (warnings []error)
type CompletedDownload ¶
type CompletedDownload struct { // File is only populated when the download is successful; points to the opened cache file File *os.File Mod *core.Mod // Hashes is only populated when the download is successful; contains all stored hashes of the file Hashes map[string]string // Error indicates if/why downloading this file failed Error error // Warnings indicates messages to show to the user regarding this file (download was successful, but had a problem) Warnings []error }
type DownloadSession ¶
type DownloadSession interface { GetManualDownloads() []core.ManualDownload StartDownloads() chan CompletedDownload SaveIndex() error }
func CreateDownloadSession ¶
func CreateDownloadSession(mods []*core.Mod, hashesToObtain []string) (DownloadSession, error)
type IndexWriter ¶
type IndexWriter struct { }
func NewIndexWriter ¶
func NewIndexWriter() IndexWriter
func (IndexWriter) Write ¶
func (m IndexWriter) Write(writable Writable) error
type PackWriter ¶
type PackWriter struct { }
func NewPackWriter ¶
func NewPackWriter() PackWriter
func (PackWriter) Write ¶
func (p PackWriter) Write(writable Writable) error
Click to show internal directories.
Click to hide internal directories.