utils

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(bashPath, path string) string

Abs Use bashPath as the working directory to return the absolute path

func BasePath

func BasePath() string

BasePath return executable file directory

func BytesToString

func BytesToString(b []byte) (str string)

BytesToString []byte to string

func StringToBytes

func StringToBytes(str string) (b []byte)

StringToBytes string to []byte

Types

type Command

type Command struct {
	Name  string
	Usage string
	Done  func() bool
}

Command client command

type Management

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

Management command management

func (*Management) AddCommand

func (m *Management) AddCommand(cmds ...Command)

AddCommand add command to management

func (*Management) Done

func (m *Management) Done(str string) (exit bool, e error)

Done .

func (*Management) Usage

func (m *Management) Usage() string

Usage .

type SortString

type SortString []string

SortString implement string sort

func (SortString) Len

func (arrs SortString) Len() int

Len is the number of elements in the collection.

func (SortString) Less

func (arrs SortString) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (SortString) Swap

func (arrs SortString) Swap(i, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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