Documentation ¶
Overview ¶
Package sgc7utils is a generated GoMock package.
Index ¶
- Constants
- Variables
- func AppendString(strs ...string) string
- func BuildVersionFile(fn string, tmpfn string, vobj *VersionObj) error
- func CloneArr3(src [][][]int) [][][]int
- func CloneIntArr(arr []int) []int
- func CloneIntArr2(arr [][]int) [][]int
- func Debug(message string, fields ...slog.Attr)
- func Err(err error) slog.Attr
- func Error(message string, fields ...slog.Attr)
- func FindInt(arr []int, val int) int
- func FindInt3(arr []int, x, y, z int) int
- func FindIntArr(arr [][]int, vals []int) int
- func FlipIntArr2(arr [][]int) [][]int
- func FormatNow(t ITime) string
- func FormatUTCDayTs(t time.Time) int64
- func GenHashCode(length int) string
- func GetCurTimestamp() int64
- func GetJsonArrayEachInt(value1 []byte, dataType1 jsonparser.ValueType, offset1 int, err1 error) (int64, error)
- func GetJsonBool(data []byte, keys ...string) (bool, bool, error)
- func GetJsonFloat(data []byte, keys ...string) (float64, bool, error)
- func GetJsonInt(data []byte, keys ...string) (int64, bool, error)
- func GetJsonInt64Arr(data []byte, keys ...string) ([]int64, error)
- func GetJsonInt64Arr2(data []byte, keys ...string) ([][]int64, error)
- func GetJsonInt64Arr3(data []byte, keys ...string) ([][][]int64, error)
- func GetJsonIntArr(data []byte, keys ...string) ([]int, error)
- func GetJsonIntArr2(data []byte, keys ...string) ([][]int, error)
- func GetJsonIntArr3(data []byte, keys ...string) ([][][]int, error)
- func GetJsonObject(data []byte, ...) error
- func GetJsonObjectArr(data []byte, ...) error
- func GetJsonString(data []byte, keys ...string) (string, bool, error)
- func HasJsonKey(data []byte, keys ...string) bool
- func IndexOfInt2Slice(arr []int, x, y int, start int) int
- func IndexOfIntSlice(arr []int, v int, start int) int
- func IndexOfStringSlice(arr []string, v string, start int) int
- func Info(message string, fields ...slog.Attr)
- func InitLogger2(appName string, appVersion string, strLevel string, isConsole bool, ...)
- func InsUniqueIntSlice(arr []int, v int) []int
- func Int2StringWithArr(val int, arr string) string
- func Int32ArrToIntArr2(arr []int32, x, y int) ([][]int, error)
- func Int32ArrToIntArr3(arr []int32, x, y, z int) ([][][]int, error)
- func Int3Arr2ToInt4Arr2(arr [][]int, val int) [][]int
- func IntArr2ToInt32Arr(arr [][]int) ([]int32, int, int)
- func IntArr3ToInt32Arr(arr [][][]int) ([]int32, int, int, int)
- func IsFloatEquals(a, b float64) bool
- func IsSameFile(fna string, fnb string) bool
- func IsSameIntArr2(arr0 [][]int, arr1 [][]int) bool
- func IsSameIntArr2Ex(arr0 [][]int, arr1 [][]int32) bool
- func IsSameIntArr2Ex2(arr0 [][]int, arr1 [][]int, x int) bool
- func LoadCSVFile(fn string, funcIsHeadRow FuncIsCSVHeadRow, funcProcCSVRow FuncProcCSVRow) error
- func LoadExcel(fn string, sheet string, onheader FuncProcHeader, ondata FuncProcData) error
- func LoadVersion(fn string) (string, error)
- func MapI64I2MapI64I32(mapII map[int64]int) map[int64]int32
- func MapII2MapI32I32(mapII map[int]int) map[int32]int32
- func Pos2Cell(x, y int) string
- func Rune2Int(r rune) int
- func String2Float64(str string) (float64, error)
- func String2Int64(str string) (int64, error)
- func Warn(message string, fields ...slog.Attr)
- type FuncIsCSVHeadRow
- type FuncProcCSVRow
- type FuncProcData
- type FuncProcHeader
- type ITime
- type MapWeights
- type MockITime
- type MockITimeMockRecorder
- type SenderStats
- type SenderStatsNode
- type ServStats
- type ServStatsMsg
- type ServStatsMsgNode
- type Time
- type VersionObj
Constants ¶
const RuneStr = "0"
const Version = "v0.2.2"
Version -
Variables ¶
var ( // ErrInvalidArrayLength - invalid array length ErrInvalidArrayLength = errors.New("invalid array length") // ErrInvalidJsonString - invalid json string ErrInvalidJsonString = errors.New("invalid json string") // ErrInvalidJsonInt - invalid json int ErrInvalidJsonInt = errors.New("invalid json int") // ErrInvalidJsonBool - invalid json bool ErrInvalidJsonBool = errors.New("invalid json bool") // ErrInvalidVersion - invalid Version ErrInvalidVersion = errors.New("invalid Version") // ErrDuplicateMsgCtx - duplicate msg ctx ErrDuplicateMsgCtx = errors.New("duplicate msg ctx") // ErrNoMsgCtx - no msg ctx ErrNoMsgCtx = errors.New("no msg ctx") // ErrInvalidMsgName - invalid MsgName ErrInvalidMsgName = errors.New("invalid MsgName") // ErrNoMsgName - no MsgName ErrNoMsgName = errors.New("no MsgName") // ErrInvalidNameInMapWeights - invalid Name in MapWeights ErrInvalidNameInMapWeights = errors.New("invalid Name in MapWeights") )
var FloatPrecision float64 = 0.00000001
Functions ¶
func BuildVersionFile ¶ added in v0.1.22
func BuildVersionFile(fn string, tmpfn string, vobj *VersionObj) error
func FindIntArr ¶ added in v0.1.2
FindIntArr - find a int array into [][]int
func FormatUTCDayTs ¶ added in v0.1.15
func GenHashCode ¶ added in v0.1.2
GenHashCode - generator a hash code
func GetCurTimestamp ¶ added in v0.1.3
func GetCurTimestamp() int64
func GetJsonArrayEachInt ¶ added in v0.1.10
func GetJsonBool ¶ added in v0.1.13
GetJsonBool - everything to bool, null -> false, 0 -> false, True -> true
func GetJsonFloat ¶ added in v0.1.2
func GetJsonInt64Arr ¶ added in v0.1.10
func GetJsonInt64Arr2 ¶ added in v0.1.10
func GetJsonInt64Arr3 ¶ added in v0.1.10
func GetJsonIntArr ¶ added in v0.1.10
func GetJsonIntArr2 ¶ added in v0.1.10
func GetJsonIntArr3 ¶ added in v0.1.10
func GetJsonObject ¶ added in v0.1.12
func GetJsonObjectArr ¶ added in v0.1.10
func GetJsonString ¶ added in v0.1.2
GetJsonString - number to string
func HasJsonKey ¶ added in v0.1.10
func IndexOfInt2Slice ¶
IndexOfInt2Slice - indexof for []int2, []int2 is like [x0, y0, x1, y1, ...]
start * 2 <--> len([]int)
func IndexOfIntSlice ¶
IndexOfIntSlice - indexof for []int
func IndexOfStringSlice ¶
IndexOfStringSlice - indexof for []string
func InitLogger2 ¶ added in v0.2.2
func InsUniqueIntSlice ¶
InsUniqueIntSlice - Insert unique int array
func Int2StringWithArr ¶ added in v0.1.46
(0, "abc") => "a", (1, "abc") => "b", (3, "abc") => "aa"
func Int32ArrToIntArr2 ¶ added in v0.1.2
Int32ArrToIntArr2 - []int32 to [][]int
func Int32ArrToIntArr3 ¶ added in v0.1.2
Int32ArrToIntArr3 - []int32 to [][][]int
func Int3Arr2ToInt4Arr2 ¶ added in v0.1.2
Int3Arr2ToInt4Arr2 - []int{x,y,z} -> []int{x,y,z,v}
func IntArr2ToInt32Arr ¶
IntArr2ToInt32Arr - [][]int to []int32
func IntArr3ToInt32Arr ¶ added in v0.1.2
IntArr3ToInt32Arr - [][][]int to []int32
func IsFloatEquals ¶
func IsSameIntArr2 ¶ added in v0.1.2
IsSameIntArr2 -
func IsSameIntArr2Ex ¶ added in v0.1.2
IsSameIntArr2Ex -
func IsSameIntArr2Ex2 ¶ added in v0.1.2
IsSameIntArr2Ex - 只比较前x个
func LoadCSVFile ¶ added in v0.1.45
func LoadCSVFile(fn string, funcIsHeadRow FuncIsCSVHeadRow, funcProcCSVRow FuncProcCSVRow) error
func LoadExcel ¶ added in v0.1.50
func LoadExcel(fn string, sheet string, onheader FuncProcHeader, ondata FuncProcData) error
func LoadVersion ¶ added in v0.1.22
func MapI64I2MapI64I32 ¶ added in v0.1.17
MapI64I2MapI64I32 - map[int64]int to map[int64]int32
func MapII2MapI32I32 ¶ added in v0.1.16
MapII2MapI32I32 - map[int]int to map[int32]int32
func String2Float64 ¶ added in v0.1.2
func String2Int64 ¶ added in v0.1.2
Types ¶
type FuncIsCSVHeadRow ¶ added in v0.1.45
type FuncProcCSVRow ¶ added in v0.1.45
type FuncProcData ¶ added in v0.1.50
type FuncProcHeader ¶ added in v0.1.50
type MapWeights ¶ added in v0.1.47
func NewMapWeights ¶ added in v0.1.47
func NewMapWeights() *MapWeights
func (*MapWeights) AddWeight ¶ added in v0.1.47
func (mapWeights *MapWeights) AddWeight(name string, weight int, isDefault bool) error
func (*MapWeights) Rand ¶ added in v0.1.47
func (mapWeights *MapWeights) Rand() string
func (*MapWeights) SetDefaultIsMaxWeight ¶ added in v0.1.48
func (mapWeights *MapWeights) SetDefaultIsMaxWeight()
type MockITime ¶
type MockITime struct {
// contains filtered or unexported fields
}
MockITime is a mock of ITime interface
func NewMockITime ¶
func NewMockITime(ctrl *gomock.Controller) *MockITime
NewMockITime creates a new mock instance
func (*MockITime) EXPECT ¶
func (m *MockITime) EXPECT() *MockITimeMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockITimeMockRecorder ¶
type MockITimeMockRecorder struct {
// contains filtered or unexported fields
}
MockITimeMockRecorder is the mock recorder for MockITime
func (*MockITimeMockRecorder) Now ¶
func (mr *MockITimeMockRecorder) Now() *gomock.Call
Now indicates an expected call of Now
type SenderStats ¶ added in v0.1.41
type SenderStats struct { MapNodes map[string]*SenderStatsNode `json:"mapMsgs,omitempty"` MaxNodes int `json:"-"` ChanState chan int `json:"-"` TickerOutput *time.Ticker `json:"-"` PathOutput string `json:"-"` // contains filtered or unexported fields }
func NewSenderStats ¶ added in v0.1.41
func (*SenderStats) Output ¶ added in v0.1.41
func (stats *SenderStats) Output()
func (*SenderStats) Push ¶ added in v0.1.41
func (stats *SenderStats) Push(name string, bytes int)
func (*SenderStats) Start ¶ added in v0.1.41
func (stats *SenderStats) Start()
func (*SenderStats) Stop ¶ added in v0.1.41
func (stats *SenderStats) Stop()
type SenderStatsNode ¶ added in v0.1.41
type ServStats ¶ added in v0.1.22
type ServStats struct { MapMsgs map[string]*ServStatsMsg `json:"mapMsgs,omitempty"` MaxNodes int `json:"-"` ChanState chan int `json:"-"` TickerOutput *time.Ticker `json:"-"` PathOutput string `json:"-"` // contains filtered or unexported fields }
func NewServStats ¶ added in v0.1.22
func (*ServStats) EndMsg ¶ added in v0.1.22
func (stats *ServStats) EndMsg(msgname string, node *ServStatsMsgNode)
func (*ServStats) StartMsg ¶ added in v0.1.22
func (stats *ServStats) StartMsg(msgname string) *ServStatsMsgNode
type ServStatsMsg ¶ added in v0.1.22
type ServStatsMsg struct { Name string `json:"name,omitempty"` TotalTime float64 `json:"totalTime,omitempty"` TotalTimes int `json:"totalTimes,omitempty"` MaxTime float64 `json:"maxTime,omitempty"` MinTime float64 `json:"minTime,omitempty"` MaxParallels int `json:"maxParallels,omitempty"` Nodes []float64 `json:"nodes,omitempty"` LastMsgNums int `json:"lastMsgNums"` // contains filtered or unexported fields }
type ServStatsMsgNode ¶ added in v0.1.22
type VersionObj ¶ added in v0.1.22
func ParseVersion ¶ added in v0.1.22
func ParseVersion(str string) (*VersionObj, error)
func (*VersionObj) IncPatch ¶ added in v0.1.22
func (vobj *VersionObj) IncPatch()
func (*VersionObj) ToString ¶ added in v0.1.22
func (vobj *VersionObj) ToString() string