gsed

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package gsed provides functionality for search and replace.

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 WithYAMLReferences added in v0.3.0

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

WithYAMLReferences 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