Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigChange

type ConfigChange struct {
	Path    string
	Version int
}

func (ConfigChange) Content

func (c ConfigChange) Content() (string, error)

func (ConfigChange) Diff

func (c ConfigChange) Diff(frompath string) ([]diffmatchpatch.Diff, error)

func (ConfigChange) Merge

func (c ConfigChange) Merge(s string) (Merge, error)

func (ConfigChange) Remove

func (c ConfigChange) Remove() error

type Configs

type Configs map[string][]ConfigChange

Configs is a map of files -> and related config change

func Scan

func Scan(path string) Configs

Scan does: 1: walk etc 2: find filenames with pattern https://github.com/mudler/luet/blob/a83be204e8bd3498a736fa9fe401fb00bb91a893/pkg/compiler/artifact.go#L457

fmt.Sprintf("._cfg%04d_%s", i, filepath.Base(path))))

3: get latest - compare with current with diff. If no diff automerge.

offer option to automerge
failback to ask. discard/accept change

fmt.Println(res)

func (Configs) CleanChanges

func (c Configs) CleanChanges(s string) error

func (Configs) Files

func (c Configs) Files() []string

func (Configs) LatestFor

func (c Configs) LatestFor(s string) ConfigChange

func (Configs) Merge

func (c Configs) Merge(s string) (Merge, error)

type Merge

type Merge struct {
	Content string
	Applies []bool
	Path    string
}

func (Merge) Apply

func (m Merge) Apply() error

Jump to

Keyboard shortcuts

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