toolbox2go

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 13 Imported by: 2

README

toolbox2go

Go utilities & tools

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func NewConfigurationFromYamlFile

func NewConfigurationFromYamlFile[T any](config T, configFilePath string) (T, error)

func NewZapLogger

func NewZapLogger(debugging bool) (*zap.Logger, error)

func NewZapSugarLogger

func NewZapSugarLogger(debugging bool) (*zap.SugaredLogger, error)

Types

type GitRepo added in v0.0.3

type GitRepo struct {
	CloneID       string
	RepoName      string
	BranchName    string
	BranchRef     string
	RepoLocalPath string
}

func NewGitRepo added in v0.0.3

func NewGitRepo(cloneID, repoName, branchName, localPath string) GitRepo

func (*GitRepo) Clone added in v0.0.3

func (g *GitRepo) Clone() error

func (*GitRepo) CommitAndPush added in v0.0.3

func (g *GitRepo) CommitAndPush(message string) error

func (*GitRepo) GetHeadCommitID added in v0.0.3

func (g *GitRepo) GetHeadCommitID() string

func (*GitRepo) Pull added in v0.0.3

func (g *GitRepo) Pull() error

Jump to

Keyboard shortcuts

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