Documentation
¶
Index ¶
- func AiBaseUuid() string
- func AppUuid() string
- func BToMb(b uint64) uint64
- func BToU16(b []byte, index int, offset int) uint16
- func BToU32(b []byte, index int, offset int) uint32
- func BToU64(b []byte, index int, offset int) uint64
- func BindConfig(config map[string]interface{}, s interface{}) error
- func BindSourceConfig(config map[string]interface{}, s interface{}) error
- func BtoMB(bytes uint64) float64
- func CRC16(data []byte) uint16
- func DeviceUuid() string
- func GenCode(fields []Field, big bool, more bool) string
- func Get(client http.Client, url string) string
- func GetINISection(iniPath string, s string) *ini.Section
- func GetOSDistribution() (string, error)
- func GetPwd() string
- func GiveMeMicroseconds(c int64) time.Duration
- func GiveMeMilliseconds(c int64) time.Duration
- func GiveMeSeconds(c int64) time.Duration
- func GoID() int
- func GoodsUuid() string
- func GroupUuid() string
- func HostNameI() ([]string, error)
- func INIToStruct(iniPath string, s string, v interface{}) error
- func InIMapToStruct(section *ini.Section, s interface{}) error
- func InUuid() string
- func IsListDuplicated(list []string) bool
- func MakeUUID(prefix string) string
- func MaoToTerm(input interface{}, output interface{}) error
- func NowTime() string
- func NowTs() int64
- func OutUuid() string
- func Paginate(pageNum int, pageSize int, sliceLength int) (int, int)
- func PluginUuid() string
- func Post(client http.Client, data interface{}, url string, headers map[string]string) (string, error)
- func ReadAtLeast(ctx context.Context, r io.Reader, buf []byte, min int) (n int, err error)
- func RuleUuid() string
- func SContains(s []string, e string) bool
- func Sleep(ts int)
- func SliceReceive(ctx context.Context, iio io.Reader, resultBuffer []byte, showError bool, ...) (int, error)
- func SliceReceiveAtLeast(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration, ...) (int, error)
- func SliceReceiveWithError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
- func SliceReceiveWithoutError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
- func SliceRequest(ctx context.Context, iio io.ReadWriter, writeBytes []byte, resultBuffer []byte, ...) (int, error)
- func TraceMemStats()
- func TransformConfig(s1 []byte, s2 interface{}) error
- func TrimZero(s string) string
- func U16ToB(v uint16, b []byte)
- func U32ToB(v uint32, b []byte)
- func U64ToB(v uint64, b []byte)
- func VisualUuid() string
- func XOR(src []byte) int
- func Zone() string
- type CpuUsage
- type DiskUsage
- type Field
- type GenLuaConfig
- type NetworkInterfaceUsage
- type SystemDevices
- type Utsname
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AiBaseUuid ¶
func AiBaseUuid() string
func BindConfig ¶
Bind config to struct config: a Map, s: a struct variable
func BindSourceConfig ¶
func DeviceUuid ¶
func DeviceUuid() string
func GetOSDistribution ¶ added in v0.5.1
* * 获取操作系统发行版版本 runtime.GOARCH:
386: 32-bit Intel/AMD x86 architecture amd64: 64-bit Intel/AMD x86 architecture arm: ARM architecture (32-bit) arm64: ARM architecture (64-bit) ppc64: 64-bit PowerPC architecture ppc64le: 64-bit little-endian PowerPC architecture mips: MIPS architecture (32-bit) mips64: MIPS architecture (64-bit) s390x: IBM System z architecture (64-bit) wasm: WebAssembly architecture
runtime.GOOS:
darwin: macOS freebsd: FreeBSD linux: Linux windows: Windows netbsd: NetBSD openbsd: OpenBSD plan9: Plan 9 dragonfly: DragonFly BSD
*
func INIToStruct ¶
func MaoToTerm ¶
func MaoToTerm(input interface{}, output interface{}) error
Map转成结构体 Decode takes an input structure and uses reflection to translate it to the output structure.
output must be a pointer to a map or struct.
func PluginUuid ¶
func PluginUuid() string
func Post ¶
func Post(client http.Client, data interface{}, url string, headers map[string]string) (string, error)
* * HTTP POST *
func ReadAtLeast ¶
func SliceReceive ¶
func SliceReceive(ctx context.Context, iio io.Reader, resultBuffer []byte, showError bool, td time.Duration) (int, error)
* * 通过一个定时时间片读取 *
func SliceReceiveAtLeast ¶
func SliceReceiveAtLeast(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration, min int) (int, error)
* * 某个时间片期望最少收到字节数 *
func SliceReceiveWithError ¶
func SliceReceiveWithError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
* * 读取数据的时候,如果出现错误就返回 *
func SliceReceiveWithoutError ¶
func SliceReceiveWithoutError(ctx context.Context, iio io.Reader, resultBuffer []byte, td time.Duration) (int, error)
* * 读取数据的时候,如果出现错误则判断是否是串口引起的超时,如果是就忽略 *
func SliceRequest ¶
func SliceRequest(ctx context.Context, iio io.ReadWriter, writeBytes []byte, resultBuffer []byte, showError bool, td time.Duration) (int, error)
* * 时间片读写请求 *
func TransformConfig ¶
JSON String to a struct, (can't validate map!!!)
func VisualUuid ¶ added in v0.6.1
func VisualUuid() string
Types ¶
type DiskUsage ¶ added in v0.5.1
type DiskUsage struct { DeviceID string `json:"deviceID"` FreeSpace float64 `json:"freeSpace"` Size float64 `json:"size"` }
* * 磁盘 *
type GenLuaConfig ¶
type NetworkInterfaceUsage ¶ added in v0.5.1
type NetworkInterfaceUsage struct { Name string CurrentBandwidth uint64 BytesTotalPerSec uint64 BytesReceivedPerSec uint64 BytesSentPerSec uint64 PacketsPerSec uint64 }
* * 网卡 *
func NetInterfaceUsage ¶ added in v0.5.1
func NetInterfaceUsage() ([]NetworkInterfaceUsage, error)
* * 获取网卡实时速率 *
func (NetworkInterfaceUsage) String ¶ added in v0.5.1
func (m NetworkInterfaceUsage) String() string
type SystemDevices ¶ added in v0.5.1
type SystemDevices struct { Uarts []string `json:"uarts"` Videos []string `json:"videos"` Audios []string `json:"audios"` }
* * 系统设备 *
func (SystemDevices) String ¶ added in v0.5.1
func (m SystemDevices) String() string
type Utsname ¶ added in v0.5.1
type Utsname struct {
// contains filtered or unexported fields
}
* * Cgo 实现, 用来获取Linux的系统参数 *
func ReleaseInfo ¶ added in v0.5.1
func ReleaseInfo() Utsname
Click to show internal directories.
Click to hide internal directories.