filter

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableFilters

func GetAvailableFilters() []model.Spec

GetAvailableFilters get all available filters

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

Chain contains filter chain

func NewChainFilter

func NewChainFilter() *Chain

NewChainFilter create new chain filter

func (*Chain) Add

func (chain *Chain) Add(filter *model.FilterDef) (model.Filter, error)

Add a filter to the chain

func (*Chain) Apply

func (chain *Chain) Apply(article *model.Article) error

Apply applies filter chain on an article

func (*Chain) Get

func (chain *Chain) Get(id int) (model.Filter, error)

Get a filter from the chain

func (*Chain) GetFilterDefs

func (chain *Chain) GetFilterDefs() []model.FilterDef

GetFilterDefs return definitions of the chain filter

func (*Chain) Remove

func (chain *Chain) Remove(filter *model.FilterDef) error

Remove a filter from the chain

func (*Chain) Update

func (chain *Chain) Update(update *model.FilterDef) (model.Filter, error)

Update a filter of the chain

type FetchFilter

type FetchFilter struct {
	// contains filtered or unexported fields
}

FetchFilter is a filter that try to fetch the original article content

func (*FetchFilter) DoFilter

func (f *FetchFilter) DoFilter(article *model.Article) error

DoFilter applies filter on the article

func (*FetchFilter) GetDef

func (f *FetchFilter) GetDef() model.FilterDef

GetDef return filter definition

type MinifyFilter

type MinifyFilter struct {
	// contains filtered or unexported fields
}

MinifyFilter is a filter that minify HTML content

func (*MinifyFilter) DoFilter

func (f *MinifyFilter) DoFilter(article *model.Article) error

DoFilter applies filter on the article

func (*MinifyFilter) GetDef

func (f *MinifyFilter) GetDef() model.FilterDef

GetDef return filter definition

type TitleFilter

type TitleFilter struct {
	// contains filtered or unexported fields
}

TitleFilter is a foo filter

func (*TitleFilter) DoFilter

func (f *TitleFilter) DoFilter(article *model.Article) error

DoFilter applies filter on the article

func (*TitleFilter) GetDef

func (f *TitleFilter) GetDef() model.FilterDef

GetDef return filter definition

Jump to

Keyboard shortcuts

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