feed

package
v1.0.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package feed helps work with a Porter package feed (mixin or plugin).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTemplate

func CreateTemplate(cxt *context.Context) error

Types

type GenerateOptions

type GenerateOptions struct {
	SearchDirectory string
	AtomFile        string
	TemplateFile    string
}

func (*GenerateOptions) Validate

func (o *GenerateOptions) Validate(c *context.Context) error

func (*GenerateOptions) ValidateSearchDirectory

func (o *GenerateOptions) ValidateSearchDirectory(cxt *context.Context) error

func (*GenerateOptions) ValidateTemplateFile

func (o *GenerateOptions) ValidateTemplateFile(cxt *context.Context) error

type MixinEntries

type MixinEntries []*MixinFileset

MixinEntries is used to sort the entries in a mixin feed by when they were last updated

func (MixinEntries) Len

func (e MixinEntries) Len() int

func (MixinEntries) Less

func (e MixinEntries) Less(i, j int) bool

func (MixinEntries) Swap

func (e MixinEntries) Swap(i, j int)

type MixinFeed

type MixinFeed struct {
	*context.Context

	// Index of mixin files
	Index map[string]map[string]*MixinFileset

	// Mixins present in the feed
	Mixins []string

	// Updated timestamp according to the atom xml feed
	Updated *time.Time
}

func NewMixinFeed

func NewMixinFeed(cxt *context.Context) *MixinFeed

func (*MixinFeed) Generate

func (feed *MixinFeed) Generate(opts GenerateOptions) error

func (*MixinFeed) Load

func (feed *MixinFeed) Load(file string) error

func (*MixinFeed) Save

func (feed *MixinFeed) Save(opts GenerateOptions) error

func (*MixinFeed) Search

func (feed *MixinFeed) Search(mixin string, version string) *MixinFileset

type MixinFile

type MixinFile struct {
	File    string
	URL     *url.URL
	Updated time.Time
}

type MixinFileset

type MixinFileset struct {
	Mixin   string
	Version string
	Files   []*MixinFile
}

func (*MixinFileset) FindDownloadURL

func (f *MixinFileset) FindDownloadURL(os string, arch string) *url.URL

func (*MixinFileset) GetLastUpdated

func (f *MixinFileset) GetLastUpdated() time.Time

func (*MixinFileset) Updated

func (f *MixinFileset) Updated() string

Jump to

Keyboard shortcuts

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