addon

package
v0.0.0-...-870e36a Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addon

type Addon interface {
	InitMetadata(string) (*Metadata, error)
	InitProfile(string) error
	Install(string) error
}

Addon represents an interface defining functionality for managing World of Warcraft addons.

func NewCurse

func NewCurse() Addon

NewCurse creates an instance of Curse.

type Curse

type Curse struct {
	Source       string
	DefaultPaths map[string]string
}

Curse represents the corresponding interface from addon.Addon

func (*Curse) InitMetadata

func (c *Curse) InitMetadata(id string) (*Metadata, error)

InitMetadata returns the metadata object of an addon parsed from Curse where the curse addon id is specified by id. Return an error if one occurred.

func (*Curse) InitProfile

func (c *Curse) InitProfile(f string) error

InitProfile creates a new profile (wam.json) with the World of Warcraft installation path specified by f. Return an error if one occurred.

func (*Curse) Install

func (c *Curse) Install(id string) error

Install downloads, extracts and installs an addon from Curse using a Curse addon id. Return an error if one occurred.

type Metadata

type Metadata struct {
	Date    int64
	Name    string
	Source  string
	Version string
}

Metadata represents an addon containing specific information such as its name, version, last updated date and source url.

type Profile

type Profile struct {
	Path   string `json:"path"`
	Addons []struct {
		Date int64  `json:"date"`
		ID   string `json:"id"`
	} `json:"addons"`
}

Profile represents the JSON marshaling structure used to identify installed addons.

Jump to

Keyboard shortcuts

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