provider

package
v0.0.0-...-9825f04 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobToRegex

func GlobToRegex(glob string) (*regexp.Regexp, error)

func GlobToRegexStr

func GlobToRegexStr(glob string) string

GlobToRegexStr converts a basic glob string to a regex e.g. "foo*bar.java" to "^foo.*bar\.java$" everything that isn't a * gets escaped

Types

type BodyFetcher

type BodyFetcher func() ([]byte, error)

type Document

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

DocumentProvider is a generic way of fetching documents from a variety of sources.

func (*Document) Body

func (d *Document) Body() ([]byte, error)

Body Fetches the contents of the source. This SHOULD be lazy because the caller might skip processing a document

func (*Document) Namespace

func (d *Document) Namespace() string

Path Grabs the path of the document

func (*Document) Path

func (d *Document) Path() string

Path Grabs the path of the document

type DocumentProducer

type DocumentProducer chan Document

func NewDummyProducer

func NewDummyProducer(producer DocumentProducer, writer io.Writer) DocumentProducer

NewDummyProducer creates a producer that consumes elements and writes their paths to the given writer. It does not pass any elements through.

func NewFileListProducer

func NewFileListProducer(namespace string, reader io.Reader) (DocumentProducer, error)

func NewFilterWrapper

func NewFilterWrapper(glob string, producer DocumentProducer) (DocumentProducer, error)

func NewGitProducer

func NewGitProducer(gitUrl string) (DocumentProducer, error)

func NewGitProvider

func NewGitProvider(gitUrl, namespace string) (DocumentProducer, error)

func NewJoinerProducer

func NewJoinerProducer(a, b DocumentProducer) DocumentProducer

func NewMultiJoinerProducer

func NewMultiJoinerProducer(producers ...DocumentProducer) DocumentProducer

func NewTreeWalkerProducer

func NewTreeWalkerProducer(directory, namespace string, ignoreHidden bool, prefixlen int) DocumentProducer

Jump to

Keyboard shortcuts

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