utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diff

func Diff(text1, text2 string) (string, error)

func Exists

func Exists(name string) bool

func GetExitCode added in v0.1.2

func GetExitCode(err error) *int

func KustomizationExists

func KustomizationExists(path string) bool

func ListKustomizeDirs

func ListKustomizeDirs(dirPath string, opts ListKustomizeDirsOpts) ([]string, error)

func MakeKustomizeDir

func MakeKustomizeDir(dirPath string) error

Types

type CommandError

type CommandError struct {
	InternalError error
	Stdout        string
	Stderr        string
}

func (*CommandError) Error

func (ce *CommandError) Error() string

type GitDir

type GitDir struct {
	GitPath string
	WorkDir WorkDir
}

func NewGitDir added in v0.1.1

func NewGitDir(dirPath, gitPath string) *GitDir

func (*GitDir) Apply

func (gd *GitDir) Apply(patch string) error

func (*GitDir) Checkout

func (gd *GitDir) Checkout(target string) error

func (*GitDir) Clone

func (gd *GitDir) Clone(dstDirPath string) (*GitDir, error)

func (*GitDir) CloneAndCheckout

func (gd *GitDir) CloneAndCheckout(dirPath, commit string) (*GitDir, error)

func (*GitDir) CommitHash

func (gd *GitDir) CommitHash(target string) (string, error)

func (*GitDir) CopyConfig

func (gd *GitDir) CopyConfig(targetGitDir *GitDir) error

func (*GitDir) CurrentBranch

func (gd *GitDir) CurrentBranch() (string, error)

func (*GitDir) Diff

func (gd *GitDir) Diff(target string) (string, error)

func (*GitDir) Fetch

func (gd *GitDir) Fetch() error

func (*GitDir) GetRootDir

func (gd *GitDir) GetRootDir() (string, error)

func (*GitDir) Merge

func (gd *GitDir) Merge(target string) error

func (*GitDir) RunGitCommand added in v0.1.1

func (gd *GitDir) RunGitCommand(args ...string) (string, string, error)

func (*GitDir) SetUser

func (gd *GitDir) SetUser() error

type ListKustomizeDirsOpts

type ListKustomizeDirsOpts struct {
	IncludeRegexp *regexp.Regexp
	ExcludeRegexp *regexp.Regexp
}

type WithCause

type WithCause interface {
	Cause() error
}

type WorkDir

type WorkDir struct {
	Dir string
	Env map[string]string
}

func (*WorkDir) RunCommand

func (wd *WorkDir) RunCommand(command string, args ...string) (string, string, error)

Jump to

Keyboard shortcuts

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