renovate

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeFromMapping

func NodeFromMapping(parentNode *yaml.Node, key string) (*yaml.Node, error)

NodeFromMapping takes a yaml.Node (a mapping) and uses yit to find a child node in the mapping with the given key.

Types

type Context

type Context struct {
	ConfigFile string
}

Context contains the default settings for renovations.

func New

func New(opts ...Option) (*Context, error)

New creates a new renovation context.

func (*Context) Renovate

func (c *Context) Renovate(ctx context.Context, renovators ...Renovator) error

Renovate loads a config file, applies a chain of Renovators to perform a renovation, and writes the result back.

type Option

type Option func(ctx *Context) error

func WithConfig

func WithConfig(configFile string) Option

WithConfig sets the config file to do renovations on.

type RenovationContext

type RenovationContext struct {
	Context       *Context
	Configuration *config.Configuration
	Vars          map[string]string
}

RenovationContext encapsulates state relating to an ongoing renovation.

func (*RenovationContext) LoadConfig

func (rc *RenovationContext) LoadConfig(ctx context.Context) error

LoadConfig loads the configuration data into an AST for renovation.

func (*RenovationContext) WriteConfig

func (rc *RenovationContext) WriteConfig() error

WriteConfig writes the modified configuration data back to the config file.

type Renovator

type Renovator func(ctx context.Context, rc *RenovationContext) error

Renovator performs a renovation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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