ggrep

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package ggrep provides functionality for replace (regenerate) generated code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(yml io.Reader, opts ...Option) error

Types

type Configuration

type Configuration struct {
	Regenerates []Regenerate `yaml:"regenerates"`
	// contains filtered or unexported fields
}

type Option

type Option func(*Configuration)

Option changes configuration.

func WithDirectory

func WithDirectory(dir string) Option

WithDirectory sets directory.

func WithGofmt

func WithGofmt(opts *imports.Options) Option

func WithReferences

func WithReferences(refs ...io.Reader) Option

WithReferences setes reference to anchor defined by passed readers.

type Regenerate

type Regenerate struct {
	File    string  `yaml:"file"`
	Replace Replace `yaml:"replace"`
}

type Regexp

type Regexp struct {
	Match       string `yaml:"match"`
	Replacement string `yaml:"replacement"`
}

type Replace

type Replace struct {
	Strings []String `yaml:"strings"`
	Regexps []Regexp `yaml:"regexps"`
}

type String

type String struct {
	Match       string `yaml:"match"`
	Replacement string `yaml:"replacement"`
}

Jump to

Keyboard shortcuts

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