plugin

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemRepo

type MemRepo struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MemRepo is a memory-backed repo

func NewMemRepo

func NewMemRepo() *MemRepo

NewMemRepo creates a memory-backed repo

func (*MemRepo) All

func (mr *MemRepo) All() []Plugin

All returns all the available plugins

func (*MemRepo) Find

func (mr *MemRepo) Find(name string) (Plugin, error)

Find finds a plugin by name

func (*MemRepo) Install

func (mr *MemRepo) Install(p Plugin)

Install installs a new plugin

type Plugin

type Plugin interface {
	Run() (*feeds.Feed, error)
	Info() PluginMetadata
}

Plugin is the interface that a scrape plugin has to implement

type PluginMetadata added in v0.1.3

type PluginMetadata struct {
	TechnicalName string
	Name          string
	Description   string
	Author        string
	AuthorURL     string
	Image         string
	SourceURL     string
}

type Repository

type Repository interface {
	Install(p Plugin)
	Find(name string) (Plugin, error)
	All() []Plugin
}

A Repository is responsible for retrieving/registering pluginFuncs

Jump to

Keyboard shortcuts

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