Documentation ¶
Index ¶
- Constants
- Variables
- func AssemblePipes(cmds []*exec.Cmd, stdin io.Reader, stdout io.Writer) []*exec.Cmd
- func AssemblePipesWithoutErr(cmds []*exec.Cmd, stdin io.Reader, stdout io.Writer) []*exec.Cmd
- func CleanCompositeParamList(configs ...define.CompositeParam) error
- func ClearTempFile(pattern string) error
- func ConvertHexStringToBytes(data string) ([]byte, error)
- func ConvertStringToBytes(data string, typ string) ([]byte, error)
- func CreateTempFile(pattern string) (*os.File, error)
- func FilterIpsWithIpType(ips []string, ipType DomainType) []string
- func GeneratorHashKey(names []string) string
- func GetDurationSecondsSince(t time.Time) float64
- func GetPtrByName(object interface{}, attr string) (interface{}, bool)
- func GetRootDevices() (int64, int64, error)
- func GetValueByName(object interface{}, attr string) (reflect.Value, bool)
- func HasTempDir() bool
- func HashIt(object interface{}) string
- func InitTempDir(clear bool) (string, error)
- func IsLinuxOS() bool
- func IsMatch(matchType string, content []byte, expect []byte) bool
- func IsMatchString(matchType string, content string, expect string) bool
- func NewDecoder(name string) *encoding.Decoder
- func NewEncoder(name string) *encoding.Encoder
- func ParseCmdline2Cmds(cmdline string, userEnvs map[string]string) ([][]string, error)
- func PathExist(path string) bool
- func PidStoreFile() string
- func ReadFileTail(p string, size int64) ([]byte, error)
- func RealReflectValue(v reflect.Value) reflect.Value
- func RecoverFor(fn func(error))
- func RunCmds(cmds []*exec.Cmd, notify chan error)
- func RunString(ctx context.Context, s string, userEnvs map[string]string) (string, error)
- func RunStringWithoutErr(ctx context.Context, s string, userEnvs map[string]string) (string, error)
- func SafeReflectValueAddrInterface(v reflect.Value) interface{}
- func SafeReflectValueInterface(v reflect.Value) interface{}
- func SetLinuxCGroup(name string, blockIO SpecBlockIO) error
- func WildcardToRegex(pattern string) string
- type Atomic
- type AtomicFunc
- type DomainType
- type GetEnver
- type HookFunction
- type HookManager
- type RpmResult
- type SpecBlockIO
Constants ¶
const ( ConvTypeRaw = "raw" ConvTypeHex = "hex" )
const ( MatchRegex = "reg" MatchEqual = "eq" MatchNotEqual = "nq" MatchStartsWith = "startswith" MatchNotStartsWith = "nstartswith" MatchEndsWith = "endswith" MatchNotEndsWith = "nendswith" MatchContains = "in" MatchNotContains = "nin" MatchWildcard = "wildcard" MatchHex = "hex" )
Variables ¶
var EncodingMaps map[string]encoding.Encoding
EncodingMaps :
var ErrScriptTimeout = fmt.Errorf("run script timeout")
ErrScriptTimeout : the error indicate that script run timeout
Functions ¶
func AssemblePipes ¶
AssemblePipes Pipe stdout of each command into stdin of next
func AssemblePipesWithoutErr ¶
AssemblePipesWithoutErr Pipe stdout of each command into stdin of next and not use stderr
func CleanCompositeParamList ¶
func CleanCompositeParamList(configs ...define.CompositeParam) error
CleanCompositeParamList 清洗符合接口定义格式的对象,是CleanCompositableConfigs的优化版
func ClearTempFile ¶
ClearTempFile clear temp file by pattern
func ConvertHexStringToBytes ¶
ConvertHexStringToBytes :
func ConvertStringToBytes ¶
ConvertStringToBytes :
func CreateTempFile ¶
CreateTempFile get temp file by pattern
func FilterIpsWithIpType ¶
func FilterIpsWithIpType(ips []string, ipType DomainType) []string
通过ipType筛选ip列表,提取指定类型的ip
func GetDurationSecondsSince ¶
func GetPtrByName ¶
GetPtrByName :
func GetRootDevices ¶
func GetValueByName ¶
GetValueByName :
func IsMatchString ¶
IsMatchString :
func ParseCmdline2Cmds ¶
ParseCmdline2Cmds parse command line to serial of sub command
func PidStoreFile ¶
func PidStoreFile() string
func RunString ¶
RunString Convert a shell command with a series of pipes into correspondingly piped list of *exec.Cmd If an arg has spaces, this will fail
func RunStringWithoutErr ¶
RunStringWithoutErr Convert a shell command with a series of pipes into correspondingly piped list of *exec.Cmd If an arg has spaces, this will fail not print error message
func SafeReflectValueAddrInterface ¶
SafeReflectValueAddrInterface :
func SafeReflectValueInterface ¶
SafeReflectValueInterface :
func SetLinuxCGroup ¶
func SetLinuxCGroup(name string, blockIO SpecBlockIO) error
Types ¶
type DomainType ¶
type DomainType int32
const ( Domain DomainType = 0 V4 DomainType = 4 V6 DomainType = 6 )
func CheckIpOrDomainValid ¶
func CheckIpOrDomainValid(addr string) DomainType
判断addr是否为有效的ipv4 ipv6 或者域名 返回值: 0-有效域名 4-有效ipv4 6-有效ipv6
type HookManager ¶
type HookManager struct {
// contains filtered or unexported fields
}
HookManager :