Documentation ¶
Index ¶
- Variables
- func B2ds(v []byte) string
- func B2i(v []byte) uint64
- func B2s(b []byte) string
- func BConcat(slices ...[]byte) []byte
- func BMap(m [][]byte, fn func(i int, k []byte) []byte) [][]byte
- func Between(v, min, max []byte) bool
- func ByteToFloat64(bytes []byte) float64
- func ByteToInt(x []byte) int
- func ByteToInt64(x []byte) int64
- func BytesTrimSpace(bs []byte) []byte
- func CheckClockDrift() error
- func CopyBytes(src []byte) []byte
- func DS2b(v string) []byte
- func DS2i(v string) uint64
- func F(format string, a ...interface{}) string
- func Float64ToByte(float float64) []byte
- func I2b(v uint64) []byte
- func If(b bool, trueVal, falseVal interface{}) interface{}
- func Int64ToByte(x int64) []byte
- func IntToByte(x int) []byte
- func NewKBuffer() *kBuffer
- func P(a ...interface{})
- func S2b(s string) []byte
- func Str(a interface{}) string
- func StrP(a interface{})
- type BufferCloser
- type LocalNtpValidator
- type PrefixedReader
Constants ¶
This section is empty.
Variables ¶
View Source
var Assert = myAssert{}
View Source
var Color = color{ // contains filtered or unexported fields }
View Source
var Err = myErr{}
View Source
var Hash = myHash{}
View Source
var Json = myJson{}
View Source
var OS = myOS{}
View Source
var Rand = myRand{ // contains filtered or unexported fields }
View Source
var Tree = myTree{}
Functions ¶
func ByteToFloat64 ¶
func ByteToInt64 ¶
func BytesTrimSpace ¶
func CheckClockDrift ¶
func CheckClockDrift() error
func DS2b ¶
DS2b returns an 8-byte big endian representation of Digit string v ("123456") -> uint64(123456) -> 8-byte big endian.
func Float64ToByte ¶
func I2b ¶
Itob returns an 8-byte big endian representation of v v uint64(123456) -> 8-byte big endian.
func NewKBuffer ¶
func NewKBuffer() *kBuffer
Types ¶
type BufferCloser ¶
NOTE: Not goroutine safe
func NewBufferCloser ¶
func NewBufferCloser(buf []byte) *BufferCloser
func (*BufferCloser) Close ¶
func (bc *BufferCloser) Close() error
func (*BufferCloser) WriteByte ¶
func (bc *BufferCloser) WriteByte(c byte) error
func (*BufferCloser) WriteString ¶
func (bc *BufferCloser) WriteString(s string) (n int, err error)
type LocalNtpValidator ¶
type LocalNtpValidator struct { // Number of measurements to do against the NTP server NtpChecks uint64 // ntpPool is the NTP server to query for the current time NtpPool string ConnReadTimeout time.Duration // Allowed clock drift before warning user DriftThreshold time.Duration // ntp服务器检测超时次数 NtpFailureThreshold int //在重复NTP警告之前需要经过的最短时间 NtpWarningCooldown time.Duration }
func (*LocalNtpValidator) Check ¶
func (v *LocalNtpValidator) Check() error
type PrefixedReader ¶
type PrefixedReader struct { Prefix []byte // contains filtered or unexported fields }
func NewPrefixedReader ¶
func NewPrefixedReader(prefix []byte, reader io.Reader) *PrefixedReader
Click to show internal directories.
Click to hide internal directories.