head

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogInfo

func LogInfo(a ...interface{})

func Main

func Main(a Aid)

Main func for Hand, Inly Greets

Types

type Aid

type Aid struct {
	O Output
	I Input
	U Utils
	S System
	L Logger
}

Aid holds everything needed in project, for all dependencies just talk to hand

func Call

func Call() Aid

Call will return in God's Hand

type Input

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

Input is collection of input dependencies

func NewInput

func NewInput() Input

NewInput creates a fresh Input with Dependencies

func (*Input) A

func (I *Input) A() int

A will increase and return Arg position

func (*Input) Args

func (I *Input) Args(i int) string

Args will read cmd

func (*Input) ExpectInt

func (I *Input) ExpectInt(p int, c func() int) (out int)

ExpectInt will first check int in arg, then fire fallback

func (*Input) ExpectStr

func (I *Input) ExpectStr(p int, c func() string) (out string)

ExpectStr will first check str in arg, then fire fallback

func (*Input) Int

func (I *Input) Int(m string) (
	out func() (i int))

Int will ask to enter integer

func (*Input) MultiChoice

func (I *Input) MultiChoice(cs []string, q string) (
	out func() (s string))

MultiChoice will return as function to str

func (*Input) Str

func (I *Input) Str(m string) (
	out func() (s string))

Str will ask to enter the string

type Logger

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

Logger ...Logger

func NewLogger

func NewLogger() Logger

NewLogger ...NewLogger

func (*Logger) Info

func (l *Logger) Info(a ...interface{})

Info ...Info

func (*Logger) SetSkip

func (l *Logger) SetSkip(i int) *Logger

SetSkip ...SetSkip

type Output

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

Output collection of dependencies

func NewOutput

func NewOutput() Output

NewOutput will return the OutPut

func (*Output) Blue

func (O *Output) Blue(format string, a ...interface{})

Blue prints blue output

func (*Output) Boxes

func (O *Output) Boxes(s map[string]interface{})

Boxes will print map in boxes

func (*Output) Error

func (O *Output) Error(format string, a ...interface{})

Error prints error output

func (*Output) Green

func (O *Output) Green(format string, a ...interface{})

Green prints green output

func (*Output) Red

func (O *Output) Red(format string, a ...interface{})

Red prints red output

func (*Output) SprintKV

func (O *Output) SprintKV(
	k string,
	v interface{}) (o string)

SprintKV will simply print the key-value pair

func (*Output) WithLB

func (O *Output) WithLB() *Output

WithLB will ask output to line break

func (*Output) WoutLB

func (O *Output) WoutLB() *Output

WoutLB will ask output to ignore line break

type Smap

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

Smap is sorted map

func NewSmap

func NewSmap() Smap

NewSmap create new smap

func (*Smap) Int

func (s *Smap) Int(k int, v interface{}) *Smap

Int will add int KV to map

func (*Smap) Keys

func (s *Smap) Keys() (l []string)

Keys will return a list of all keys

func (*Smap) Pad

func (s *Smap) Pad() string

Pad will return the padding for keys

func (*Smap) SetPad

func (s *Smap) SetPad(p string) *Smap

Pad will set the padding for keys

func (*Smap) SprintLn

func (s *Smap) SprintLn() (o string)

SprintLn will simply the map in sorted order

func (*Smap) String

func (s *Smap) String(k string, v interface{}) *Smap

String will add string KV to map

type System

type System struct{}

System in the container of all system dependencies

func NewSystem

func NewSystem() System

NewSystem returns new system

func (*System) AbsPath

func (s *System) AbsPath(p string) string

AbsPath returns absolute path

func (*System) Exec

func (s *System) Exec(c string, a ...string) string

Exec will excute a command silently

func (*System) PathExists

func (s *System) PathExists(p string) bool

PathExists check if path exists

func (*System) ReadDir

func (s *System) ReadDir(p string, a ...interface{}) (dirs []string)

ReadDir lists the directory in non-recursive fashion

func (*System) ReadFiles

func (s *System) ReadFiles(p string, a ...interface{}) (files []string)

ReadFiles lists files in recursive manner

type Utils

type Utils struct{}

Utils is the container of utility dependencies

func NewUtils

func NewUtils() Utils

NewUtils returns new util

func (*Utils) LeftPad

func (U *Utils) LeftPad(v interface{}, p string) (o string)

LeftPad will simply pad the string

func (*Utils) SliceKeys

func (U *Utils) SliceKeys(m map[interface{}]interface{}) (l []interface{})

SliceKeys will return all keys in map

func (*Utils) Smap

func (U *Utils) Smap() Smap

Smap wil return new Smap

func (*Utils) SortByKeys

func (U *Utils) SortByKeys(
	m map[interface{}]interface{},
	c func(k string, v interface{}) string,
	p string) (
	o string)

SortByKeys will sort map by key

Jump to

Keyboard shortcuts

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