Documentation ¶
Index ¶
Constants ¶
const (
DefaultUserAgent = "package-feeds (github.com/ossf/package-feeds)"
)
Variables ¶
var ErrNoPackagesPolled = errors.New("no packages were successfully polled")
Functions ¶
Types ¶
type FeedOptions ¶
type FeedOptions struct { // A collection of package names to poll instead of standard firehose behaviour. // Not supported by all feeds. Packages *[]string `yaml:"packages"` // Cron string for scheduling the polling for the feed. PollRate string `yaml:"poll_rate"` }
General configuration options for feeds.
type LossyFeedAlerter ¶
type LossyFeedAlerter struct {
// contains filtered or unexported fields
}
func NewLossyFeedAlerter ¶
func NewLossyFeedAlerter(eventHandler *events.Handler) *LossyFeedAlerter
Creates a LossyFeedAlerter, capable of tracking packages and identifying potential loss in feeds using RSS style APIs. This can only be used in feeds which produce an overlap of packages upon their requests to the API, if a timestamp is used to query the API then loss is unlikely due to requesting data since a previous query.
func (*LossyFeedAlerter) ProcessPackages ¶
func (lfa *LossyFeedAlerter) ProcessPackages(feed string, packages []*Package)
Processes a new collection of packages and compares against the previously processed slice of packages, if an overlap is not detected this is a sign of potential loss of data and the configured event handler is notified via a LossyFeedEvent.
type Package ¶
type Package struct { Name string `json:"name"` Version string `json:"version"` CreatedDate time.Time `json:"created_date"` Type string `json:"type"` ArtifactID string `json:"artifact_id"` SchemaVer string `json:"schema_ver"` }
Marshalled json output validated against package.schema.json.
func NewArtifact ¶
NewArtifact creates a Package object with the artifact ID field populated.
type PackagePollError ¶
func (PackagePollError) Error ¶
func (err PackagePollError) Error() string
type ScheduledFeed ¶
type UnsupportedOptionError ¶
func (UnsupportedOptionError) Error ¶
func (err UnsupportedOptionError) Error() string
Directories ¶
Path | Synopsis |
---|---|
package packagist fetches packages updates from the API and static files from packagist for getting the version information.
|
package packagist fetches packages updates from the API and static files from packagist for getting the version information. |