rulespatterns

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAction = errors.New("invalid action")
View Source
var ErrMalformedDepthPath = errors.New("malformed depth path")
View Source
var ErrMalformedPattern = errors.New("malformed pattern")
View Source
var ErrTooDeep = errors.New("too many subdirs in depth path")

Functions

This section is empty.

Types

type Config

type Config struct {
	Patterns     []string
	EnabledPaths []string
}

type Finder

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

`rulespatterns.Finder` applies a list of patterns to identify repo candidates. Create with `NewFinder()`. Example `Patterns`:

superrepo .
superrepo foo
     repo foo/overview
    enter foo/data
     repo foo/data/*
   ignore foo/*
   ignore *

`EnabledPaths` is a list of `<depth> <path>` pairs that are prepended before the patterns as follows:

0 foo  ->  "superrepo foo"
1 foo  ->  "superrepo foo", "superrepo foo/*"
2 foo  ->  "superrepo foo", "superrepo foo/*", "superrepo foo/*/*"

func NewFinder

func NewFinder(cfg Config) (*Finder, error)

func (*Finder) Find

func (f *Finder) Find(
	root string, known map[string]bool, fns rules.FindHandlerFuncs,
) error

Jump to

Keyboard shortcuts

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