config

package
v0.0.0-...-8f845b4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	FilePatterns []string       `json:"filePatterns"`
	Paths        []string       `json:"paths"`
	TextPatterns []*TextPattern `json:"textPatterns"`
}

A Configuration structure represents the data necessary to configure a Mini Text Indexer instance.

func LoadConfiguration

func LoadConfiguration(reader io.Reader) (*Configuration, error)

LoadConfiguration reads data from a Reader into a new Configuration structure.

func LoadConfigurationFromFile

func LoadConfigurationFromFile(fileName string) (*Configuration, error)

LoadConfigurationFromFile reads data from a file into a Configuration object. Makes use of LoadConfiguration().

type TextPattern

type TextPattern struct {
	Key     int    `json:"key"`
	Pattern string `json:"pattern"`
	Regex   *regexp.Regexp
}

A TextPattern is a structure that describes a regular expression for capturing text in documents. The Key tells which capture from the regex capture groups that should be used as the key for tree nodes.

Jump to

Keyboard shortcuts

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