util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const WorkerCount = 128

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation(cmd *cobra.Command, s string, args ...interface{}) bool

func AskForInput

func AskForInput(cmd *cobra.Command, s string) string

func AskForPassword

func AskForPassword(cmd *cobra.Command, s string) (string, error)

func CollectFiles

func CollectFiles(a FileCollectibleArchive) ([]*archive.FileInfo, error)

func ComputeChecksum

func ComputeChecksum(fs afero.Fs, path string) (string, error)

func ComputeChecksumFromBytes

func ComputeChecksumFromBytes(content []byte) string

func FileExists

func FileExists(path string) bool

func FindFilesByGlobs

func FindFilesByGlobs(fs fs.FS, globs ...string) []string

func FindFilesByGlobsIgnore

func FindFilesByGlobsIgnore(baseFS fs.FS, ignoreFunc func(path string) bool, globs ...string) []string

func IsPathIgnored

func IsPathIgnored(path string) bool

func PasswordDoublePrompt

func PasswordDoublePrompt(cmd *cobra.Command, s string) func() (string, error)

func PasswordPrompt

func PasswordPrompt(cmd *cobra.Command, s string) func() (string, error)

func RunPeriodicallyAndOnceAfterDone

func RunPeriodicallyAndOnceAfterDone(
	ctx context.Context,
	period time.Duration,
	f func() error,
) error

Types

type FileCollectibleArchive

type FileCollectibleArchive interface {
	StoredFiles() ([]string, error)
	FileInfo(filename string) (*archive.FileInfo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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