Documentation ¶
Index ¶
- Variables
- func AskYesNo(msg string, def string) int
- func Bytes2StrLit(b []byte) string
- func Bytes2hex(s []byte) string
- func ContextWithProp(ctx context.Context, p *properties.Properties) context.Context
- func ExtractIshellContext(ctx context.Context) *ishell.Context
- func GetArgsAndOptionFlag(rawArgs []string) ([]string, []string)
- func GetStringLit(raw string) ([]byte, error)
- func HasForceYes(ctx context.Context) bool
- func Hexstr2bytes(hexStr string) ([]byte, error)
- func InitBuiltinVaribles()
- func IsStringLit(raw string) bool
- func IsVar(s string) bool
- func NextKey(k []byte) []byte
- func OutputWithElapse(f func() error) error
- func Print(a ...interface{})
- func PrintGlobalVaribles()
- func PrintSysVaribles()
- func PrintTable(data [][]string)
- func PropFromContext(ctx context.Context) *properties.Properties
- func SetOptByString(ss []string, props *properties.Properties) error
- func SysVarGet(varname string) (string, bool)
- func SysVarSet(varname, val string)
- func VarGet(varname string) ([]byte, bool)
- func VarSet(varname string, val []byte)
- type ProgressReader
- type StrLitType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
SysVarPrintFormatKey string = "sys.printfmt"
)
Functions ¶
func Bytes2StrLit ¶
func ContextWithProp ¶
func ContextWithProp(ctx context.Context, p *properties.Properties) context.Context
func GetArgsAndOptionFlag ¶
GetArgsAndOptionFlag returns args and option flag Example: ['arg1', 'arg2', '--option-a=value', '--option-b'] => {args: ['arg1', 'arg2'], optionFlag: ['--option-a=value', '--option-b']} ['arg1', '--option1', 'arg2', '--option2'] => {args: ['arg1', 'arg2'], optionFlag: ['--option1', '--option2']}
func GetStringLit ¶
func HasForceYes ¶
func Hexstr2bytes ¶
func InitBuiltinVaribles ¶
func InitBuiltinVaribles()
func IsStringLit ¶
func OutputWithElapse ¶
func PrintGlobalVaribles ¶
func PrintGlobalVaribles()
func PrintSysVaribles ¶
func PrintSysVaribles()
func PrintTable ¶
func PrintTable(data [][]string)
func PropFromContext ¶
func PropFromContext(ctx context.Context) *properties.Properties
func SetOptByString ¶
func SetOptByString(ss []string, props *properties.Properties) error
Types ¶
type ProgressReader ¶
type ProgressReader struct {
// contains filtered or unexported fields
}
func NewProgressReader ¶
func NewProgressReader(r io.Reader, total int64) *ProgressReader
func OpenFileToProgressReader ¶
func OpenFileToProgressReader(fname string) (*os.File, *ProgressReader, error)
func (*ProgressReader) Error ¶
func (pr *ProgressReader) Error() error
func (*ProgressReader) GetProgress ¶
func (pr *ProgressReader) GetProgress() float64
type StrLitType ¶
type StrLitType int
String Literal Parsing h'12332321' <---- Hex string
const ( StrLitHex StrLitType = iota StrLitNormal )
Click to show internal directories.
Click to hide internal directories.