Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportedStackStrings ¶
func SupportedStackStrings() []string
SupportedStackStrings returns a slice of all String values of the enum
Types ¶
type Handler ¶
Handler is an interface representing the ability to build a list of Package from the information that a struct has.
func CreateStackHandler ¶
func CreateStackHandler(stack SupportedStack, version, bundle string) Handler
CreateStackHandler constructs and returns a stack handler if supported. It returns nil otherwise.
Note: bundle is ignored if selected stack is known for not to be split in bundles.
type KDEHandler ¶
KDEHandler returns a list of packages by parsing an HTML page from the KDE project. Since KDE is split among various bundles, this struct keeps only track of one of them. If you need to handle multiple bundles, you'll need to instantiate multiple KDE objects.
func NewKDEHandler ¶
func NewKDEHandler(bundle, version string) KDEHandler
NewKDEHandler returns a struct to handle the KDE stack, with a default base URL.
func (KDEHandler) FetchPackages ¶
func (kde KDEHandler) FetchPackages() ([]Package, error)
FetchPackages returns a list of Package objects belonging to the bundle and version specified in the KDE handler.
type Package ¶
Package represents a piece of software from a certain stack.
func PackageFromFilename ¶
PackageFromFilename parses a package's filename and returns a stack.Package instance if all was successful. It expects a filename structured in this way: `pkgname-version.some.extension`.
PackageFromFilename also takes a `url` argument since there's no way to get it from a filename.
type SupportedStack ¶
type SupportedStack int
SupportedStack represents a stack supported by this package.
const ( // KDE enum KDE SupportedStack = iota )
func SupportedStackString ¶
func SupportedStackString(s string) (SupportedStack, error)
SupportedStackString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func SupportedStackValues ¶
func SupportedStackValues() []SupportedStack
SupportedStackValues returns all values of the enum
func (SupportedStack) IsASupportedStack ¶
func (i SupportedStack) IsASupportedStack() bool
IsASupportedStack returns "true" if the value is listed in the enum definition. "false" otherwise
func (SupportedStack) String ¶
func (i SupportedStack) String() string