yo

package
v0.0.0-...-2168d6d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubroutine

func AddSubroutine(name string, arguments []string, description string, fn func([]string))

func Attach

func Attach(l Logger)

func BoolG

func BoolG(s string) bool

func Boolf

func Boolf(short, long, description string)

Boolf cannot be true by default.

func Confirm

func Confirm(message string)

func Durationf

func Durationf(short, long, description string, t time.Duration)

func FSpew

func FSpew()

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(f string, args ...interface{})

func Float64G

func Float64G(s string) float64

func Float64f

func Float64f(short, long, description string, def float64)

func GetExe

func GetExe() string

func GetValue

func GetValue(s string) interface{}

func Help

func Help()

func Init

func Init()

func Int64G

func Int64G(s string) int64

func Int64f

func Int64f(short, long, description string, def int64)

func Main

func Main(description string, fn func(s []string))

func MainArgs

func MainArgs(arguments []string, description string, fn func([]string))

func Ok

func Ok(args ...interface{})

func Okf

func Okf(f string, args ...interface{})

func Printf

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

func Println

func Println(args ...interface{})

func Puke

func Puke(v interface{})

func Spew

func Spew(v interface{})

func StringG

func StringG(s string) string

func Stringf

func Stringf(short, long, description, def string)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(f string, args ...interface{})

Types

type Def

type Def struct {
	Type       Type
	Long       string
	Definition string
	Value      interface{}
}

type FlagParser

type FlagParser struct {
	Called   []string
	Defs     map[string]*Def
	Routines map[string]*Routine
}

func (*FlagParser) Help

func (f *FlagParser) Help(exe string)

func (*FlagParser) Parse

func (f *FlagParser) Parse(s string) error

func (*FlagParser) SortedDefs

func (s *FlagParser) SortedDefs() []string

func (*FlagParser) SortedRoutines

func (s *FlagParser) SortedRoutines() []string

type Lg

type Lg struct {
	Level  int64
	Logger Logger
}

func L

func L(i int64) *Lg

func (*Lg) Log

func (l *Lg) Log(ld LogData)

func (*Lg) Ok

func (l *Lg) Ok(args ...interface{})

func (*Lg) Okf

func (l *Lg) Okf(f string, args ...interface{})

func (*Lg) Printf

func (l *Lg) Printf(f string, args ...interface{})

func (*Lg) Println

func (l *Lg) Println(args ...interface{})

func (*Lg) Spew

func (l *Lg) Spew(v interface{})

func (*Lg) Warn

func (l *Lg) Warn(args ...interface{})

func (*Lg) Warnf

func (l *Lg) Warnf(f string, args ...interface{})

type LogData

type LogData struct {
	Level LogLevel
	Time  time.Time
	Data  string
}

type LogLevel

type LogLevel uint8
const (
	LOkay  LogLevel = 0
	LDebug LogLevel = 1
	LWarn  LogLevel = 2
	LFatal LogLevel = 3
)

type Logger

type Logger interface {
	Log(LogData)
}

func NewConsoleColor

func NewConsoleColor() Logger

type Routine

type Routine struct {
	Handler     func([]string)
	Arguments   []string
	Description string
}

type Type

type Type int
const (
	String Type = iota
	Bool
	Int64
	Float64
	Duration
)

Jump to

Keyboard shortcuts

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