prelude

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package prelude contains the most commonly used utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CD

func CD(dir string) (interface{}, error)

func Cat

func Cat(filename string) (string, error)

func Echo added in v0.0.4

func Echo(args ...interface{}) string

func Exit

func Exit(code int, args ...interface{}) (interface{}, error)

func FuncMap

func FuncMap() template.FuncMap
func Head(input interface{}) interface{}

func PWD

func PWD() (string, error)

func Printf

func Printf(format string, args ...interface{}) string

func Reverse

func Reverse(input interface{}) interface{}

func Sort

func Sort(input interface{}) interface{}

func Stdin added in v0.0.4

func Stdin() (string, error)

func Tail

func Tail(input interface{}) interface{}

func Tee

func Tee(filename, input string) (string, error)

func ToGo

func ToGo(input interface{}) (string, error)

func ToJSON

func ToJSON(input interface{}) (string, error)

func ToPrettyJSON

func ToPrettyJSON(input interface{}) (string, error)

func ToPrettyXML

func ToPrettyXML(input interface{}) (string, error)

func ToShell

func ToShell(input interface{}) (string, error)

func ToString

func ToString(input interface{}) string

func ToStringSlice

func ToStringSlice(input interface{}) []string

func ToTOML

func ToTOML(input interface{}) (string, error)

func ToXML

func ToXML(input interface{}) (string, error)

func ToYAML

func ToYAML(input interface{}) (string, error)

func TypeOf

func TypeOf(input interface{}) reflect.Type

Types

type Directory added in v0.0.4

type Directory struct {
	// contains filtered or unexported fields
}

func Mkdir added in v0.0.4

func Mkdir(path string) (*Directory, error)

func (Directory) String added in v0.0.4

func (d Directory) String() string

type ExecRet

type ExecRet struct {
	Pid    int    `json:"pid"`
	Status int    `json:"status"`
	Stdout string `json:"stdout"`
	Stderr string `json:"stderr"`
}

func Exec

func Exec(bin string, args ...string) (*ExecRet, error)

func Make added in v0.0.4

func Make(target string) (*ExecRet, error)

func (ExecRet) String

func (ret ExecRet) String() string

type FZFRet

type FZFRet struct {
	Stdout string `json:"stdout"`
}

func FZF

func FZF(input interface{}) (*FZFRet, error)

func (FZFRet) String

func (ret FZFRet) String() string

type File

type File struct {
	// contains filtered or unexported fields
}

func Glob added in v0.0.4

func Glob(pattern string) ([]*File, error)

func Ls

func Ls(path ...string) ([]*File, error)

func Touch added in v0.0.4

func Touch(name string) (*File, error)

func (File) String

func (f File) String() string

Jump to

Keyboard shortcuts

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