util

package
v0.0.0-...-78b33c2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DictLowerAlphaNum = "0123456789abcdefghijklmnopqrstuvwxyz"

Variables

This section is empty.

Functions

func GenericFilter

func GenericFilter(input func(in io.WriteCloser)) string

func GenericMultiFilter

func GenericMultiFilter(input func(in io.WriteCloser)) []string

GenericMultiFilter shells out to the fzf binary to perform user-controlled filtering on a given input. From https://junegunn.kr/2016/02/using-fzf-in-your-program

func RandHash

func RandHash(length int) string

RandHash generates a random string of lowercase alphanumeric characters of the given length.

func Run

func Run(stdin io.Reader, stdout, stderr io.Writer, executable string, args ...string) ([]byte, []byte, error)

Run executes the program at the given path with the given args, and returns the output from stdout and stderr as bytes. Output may also be tee'd to an io.Writer for either one, or dropped if they are set to nil.

func StringFilter

func StringFilter(input []string) string

Types

type CmdRunner

type CmdRunner interface {
	Check() error
	Version() (string, error)
}

Jump to

Keyboard shortcuts

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