Documentation ¶
Overview ¶
Package filters implements text filtering.
Index ¶
- func Register(name string, maker Maker)
- type CSSMin
- type Collection
- func (c *Collection) Add(key string, filterName string, args []string) error
- func (c *Collection) AddFromYAML(key string, line interface{}) error
- func (c *Collection) ApplyFilter(key string, in []byte) (out []byte, err error)
- func (c *Collection) Get(key string) Filter
- func (c *Collection) SetEnabled(enabled bool)
- type Exec
- type Filter
- type HTMLMin
- type JSMin
- type Maker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection is a collection of filters addressed by some key.
func (*Collection) Add ¶
func (c *Collection) Add(key string, filterName string, args []string) error
Add adds the filter to collection to be addressable by key.
func (*Collection) AddFromYAML ¶
func (c *Collection) AddFromYAML(key string, line interface{}) error
AddFromYAML parses a `filters` value (line) and adds corresponding filters.
func (*Collection) ApplyFilter ¶
func (c *Collection) ApplyFilter(key string, in []byte) (out []byte, err error)
ApplyFilter applies a filter found by key to the given string. If the filter wasn't found, returns the original string.
func (*Collection) Get ¶
func (c *Collection) Get(key string) Filter
Get returns a filter for key. It returns nil if the filter wasn't found.
func (*Collection) SetEnabled ¶
func (c *Collection) SetEnabled(enabled bool)
SetEnabled sets enabled state of the collection.
Click to show internal directories.
Click to hide internal directories.