Documentation
¶
Index ¶
- func ConvertToRegExp(rexp []string) (r []*regexp.Regexp)
- func NewIndexer(engine string, config indexer.Config) (index indexer.Handler, err error)
- func ScanToPipe(fp string, pipeline *Pipeline, index indexer.Handler) indexer.Record
- func Setup(c *caddy.Controller) (err error)
- type Config
- type Pipeline
- type QueryResults
- type Result
- type Search
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToRegExp ¶
ConvertToRegExp compile a string regular expression to multiple *regexp.Regexp instances
func NewIndexer ¶
NewIndexer creates a new Indexer with the received config
func ScanToPipe ¶
ScanToPipe ...
func Setup ¶
func Setup(c *caddy.Controller) (err error)
Setup creates a new middleware with the given configuration
Types ¶
type Config ¶
type Config struct { HostName string Engine string Path string IncludePaths []*regexp.Regexp ExcludePaths []*regexp.Regexp Endpoint string IndexDirectory string Template *template.Template Expire time.Duration SiteRoot string }
Config represents this middleware configuration structure
func ParseSearchConfig ¶
func ParseSearchConfig(c *caddy.Controller, cnf *httpserver.SiteConfig) (*Config, error)
ParseSearchConfig controller information to create a IndexSearch config
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline is the structure that holds search's pipeline infos and methods
func NewPipeline ¶
NewPipeline creates a new Pipeline instance
func (*Pipeline) Piper ¶
func (p *Pipeline) Piper() piper.Handler
Piper is a func that returns the piper.Handler
func (*Pipeline) ValidatePath ¶
ValidatePath is the method that checks if the target page can be indexed
type QueryResults ¶
type QueryResults struct { httpserver.Context Query string Results []Result }
type Search ¶
Search represents this middleware structure
func (*Search) SearchHTML ¶
SearchHTML renders the search results in the HTML template
func (*Search) SearchJSON ¶
SearchJSON renders the search results in JSON format