generator

package
v0.1.113 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateServiceTemplate

func GenerateServiceTemplate(ctx context.Context, dir string) error

Types

type Grep

type Grep struct {
	Root       string
	Extensions []string
	Matcher    Matcher
	Excludes   []string
}

func NewGrep

func NewGrep(root string, extensions []string, matcher Matcher, excludes []string) *Grep

func (*Grep) Exclude

func (g *Grep) Exclude(p string) bool

func (*Grep) FindFiles

func (g *Grep) FindFiles(ctx context.Context, expand HitExpansion) (*MatchSummary, error)

type HitExpansion

type HitExpansion = func(hit string) []string

type Match

type Match struct {
	Matches []string
}

type MatchSummary

type MatchSummary struct {
	FileMatches map[string]Match
	Hits        []string
}

func (*MatchSummary) Pretty

func (summary *MatchSummary) Pretty() string

type Matcher

type Matcher interface {
	Match(data []byte) [][]byte
}

func NewRegexpMatcher

func NewRegexpMatcher(ctx context.Context, pattern string) (Matcher, error)

type RegexpMatcher

type RegexpMatcher struct {
	Pattern *regexp.Regexp
}

func (RegexpMatcher) Match

func (r RegexpMatcher) Match(data []byte) [][]byte

Jump to

Keyboard shortcuts

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