utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Out = bufio.NewWriter(os.Stdout)

	IsWindows = (runtime.GOOS == "windows")
	IsLinux   = (runtime.GOOS == "linux")
	IsMac     = (runtime.GOOS == "darwin")
)

Functions

func CliArgs

func CliArgs(c *cli.Context) []string

func CliArgsForEach

func CliArgsForEach(c *cli.Context, fun func(val string))

func FOutStructJson

func FOutStructJson(object interface{})

func FOutStructJsonSlim

func FOutStructJsonSlim(object interface{})

func Fprint

func Fprint(v ...interface{})

func Fprintf

func Fprintf(format string, v ...interface{})

func Fprintln

func Fprintln(v ...interface{})

func GetConsoleMultipleLine

func GetConsoleMultipleLine(message string) string

func ListDirs

func ListDirs(_dir string, indent string)

func ListUtility

func ListUtility(print func())

func OutStructJson

func OutStructJson(object interface{})

func OutStructJsonSlim

func OutStructJsonSlim(object interface{})

func Print

func Print(v ...interface{})

func Printf

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

func Println

func Println(v ...interface{})

func Question

func Question(question []*survey.Question, st interface{})

func SpaceRight

func SpaceRight(val string, len int) string

func StructToJsonStr

func StructToJsonStr(object interface{}) (string, error)

Types

type Assert

type Assert struct {
	Err error
}

func EAssert

func EAssert(err error) Assert

func (Assert) ErrNil

func (self Assert) ErrNil() bool

func (Assert) ErrNotNil

func (self Assert) ErrNotNil() bool

func (Assert) Exit

func (self Assert) Exit() Assert

func (Assert) ExitWith

func (self Assert) ExitWith(number int) Assert

func (Assert) Log

func (self Assert) Log() Assert

func (Assert) NoneErr

func (self Assert) NoneErr(elseFun func()) Assert

func (Assert) NoneErrAssert

func (self Assert) NoneErrAssert(e error) Assert

func (Assert) NoneErrPrint

func (self Assert) NoneErrPrint(str ...interface{}) Assert

func (Assert) NoneErrPrintln

func (self Assert) NoneErrPrintln(str ...interface{}) Assert

func (Assert) OnErr

func (self Assert) OnErr(errFn func()) Assert

func (Assert) Return

func (self Assert) Return() error

type Judge

type Judge struct {
	Value interface{}
	// contains filtered or unexported fields
}

func Is

func Is(flag bool) Judge

func (Judge) F

func (judge Judge) F(val interface{}) Judge

func (Judge) False

func (judge Judge) False(val interface{}) Judge

func (Judge) T

func (judge Judge) T(val interface{}) Judge

func (Judge) True

func (judge Judge) True(val interface{}) Judge

Jump to

Keyboard shortcuts

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