feed

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 18 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 *portercontext.Context) error

Types

type GenerateOptions

type GenerateOptions struct {
	SearchDirectory string
	AtomFile        string
	TemplateFile    string
}

func (*GenerateOptions) Validate

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

func (*GenerateOptions) ValidateSearchDirectory

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

func (*GenerateOptions) ValidateTemplateFile

func (o *GenerateOptions) ValidateTemplateFile(cxt *portercontext.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 {
	*portercontext.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 *portercontext.Context) *MixinFeed

func (*MixinFeed) Generate

func (feed *MixinFeed) Generate(ctx context.Context, opts GenerateOptions) error

func (*MixinFeed) Load

func (feed *MixinFeed) Load(ctx context.Context, 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(ctx context.Context, 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