Documentation ¶
Index ¶
- Constants
- Variables
- func BaseDir() string
- func DumpHex(bs []byte, wordsPerLine ...int) (s string)
- func ExecCommandAndFind(cmd Command, pattern string) (exitStatus int, results []string, err error)
- func Exists(path string) bool
- func FilePathJoinSafely(base string, children ...string) (string, error)
- func FindByRegexp(in, pattern string) (match []string)
- func GenKeyForMap(values ...string) string
- func GetBoolFromArgs(key string, defaultValueOrNone ...bool) (value bool)
- func GetFileInfo(path string) (abs, dir, pureFilename, suffix string)
- func GetFromArgs(key string, defaultValueOrNone ...string) (value string)
- func GetFuncInfo(skip int) (file string, line int, funcName string, ok bool)
- func GetIPs() (map[string][]*Address, error)
- func GetIntFromArgs(key string, defaultValueOrNone ...int64) (value int64)
- func GetInterface(flags ...net.Flags) ([]net.Interface, error)
- func GetInterfaceName(flags ...net.Flags) (names []string, e error)
- func GetLinuxStylePath(path string) (linuxPath string)
- func GetUintFromArgs(key string, defaultValueOrNone ...uint64) (value uint64)
- func HideString(s string, beginPosShown int, endPosShownOrNone ...int) string
- func IsByteVisible(c byte) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func JsonDump(v interface{}, indent int) string
- func MergeMap(dest, addition map[string]interface{})
- func MergeStruct(dest, addition interface{}) error
- func Panic(err error, reason ...string)
- func PickArgs() map[string]string
- func PrintStack()
- func PythonLikePos(length, beg int, endOrNone ...int) (begin, end int)
- func PythonLikeSlice(s string, beg int, endOrNone ...int) string
- func RelativeDirByBase(targpath string) string
- func ResetHiddenReplacer(r string)
- func StructToMap(o interface{}) map[string]interface{}
- func StructToString(s interface{}, showZero ...bool) (result string)
- func VectorToMap(vector interface{}, keys ...string) (mapResult *map[string]interface{})
- type Address
- func (a Address) ConvertIPNet() (string, error)
- func (a Address) GetIpType() IpType
- func (a Address) MarshalJSON() ([]byte, error)
- func (a Address) String() (CIDR string)
- func (a Address) ToMultiaddr(returnErr ...*error) multiaddr.Multiaddr
- func (a *Address) ToTcpAddr(portOrNone ...int) (*net.TCPAddr, error)
- func (a *Address) UnmarshalJSON(data []byte) error
- type CIDRAddress
- type Command
- type ExecResult
- type IpType
- type MyError
- type Version
- func (v *Version) Equal(w *Version) bool
- func (v *Version) FromDB(data []byte) error
- func (v *Version) GreaterThan(w *Version) bool
- func (v *Version) IsZero() bool
- func (v Version) MarshalJSON() ([]byte, error)
- func (v *Version) Set(ver string) error
- func (v *Version) String() string
- func (v *Version) ToDB() ([]byte, error)
- func (v *Version) UnmarshalJSON(data []byte) error
- func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
View Source
const ( IpTypeUnknown = iota IpTypeV4 IPTypeV6 )
View Source
const Separator = '='
Variables ¶
View Source
var (
)
View Source
var IsRelByBasedir = true
Functions ¶
func ExecCommandAndFind ¶
func FindByRegexp ¶
func GenKeyForMap ¶
func GetBoolFromArgs ¶
func GetFileInfo ¶
func GetFromArgs ¶
func GetIntFromArgs ¶
func GetLinuxStylePath ¶ added in v0.0.2
func GetUintFromArgs ¶
func IsByteVisible ¶ added in v0.0.2
func MergeStruct ¶ added in v0.0.3
func MergeStruct(dest, addition interface{}) error
func PrintStack ¶
func PrintStack()
func PythonLikePos ¶
func RelativeDirByBase ¶
func ResetHiddenReplacer ¶
func ResetHiddenReplacer(r string)
func StructToMap ¶ added in v0.0.3
func StructToMap(o interface{}) map[string]interface{}
func StructToString ¶ added in v0.0.3
func VectorToMap ¶
Types ¶
type Address ¶
func GetIPByInterfaceName ¶
func NewAddress ¶
func (Address) ConvertIPNet ¶
func (Address) MarshalJSON ¶
func (Address) ToMultiaddr ¶
func (*Address) UnmarshalJSON ¶
type CIDRAddress ¶
type CIDRAddress string
DEPRECATED:
func (CIDRAddress) ToAddress ¶
func (s CIDRAddress) ToAddress() (*Address, error)
type Command ¶
func NewCommand ¶
type ExecResult ¶
func ExecCommand ¶
func ExecCommand(name string, arg ...string) *ExecResult
func ExecCommandContext ¶
func ExecCommandContext(ctx context.Context, name string, arg ...string) *ExecResult
func NewExecResult ¶
func NewExecResult(stdout, stderr string, execErr error) *ExecResult
type MyError ¶
func DealWithPanic ¶
func DealWithPanic(panicVal interface{}) *MyError
type Version ¶
type Version struct { Major uint16 // 主版本号 Minor uint16 // 次版本号 Patch uint16 // 修订版本号 Addition string // 附加信息 }
func NewVersion ¶
@param {string} ver 字符串格式的版本号,兼容格式 [v]1.2.3{foo}
func (*Version) GreaterThan ¶
func (Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
func (*Version) UnmarshalYAML ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.