Documentation ¶
Overview ¶
Package utils ...
Package utils xxx
Index ¶
- Constants
- func EnsureTable(ctx context.Context, db drivers.DB, tableName string, indexes []drivers.Index) error
- func GetIPv6AddrFromEnv() string
- func GetListenAddr(addr, port string) string
- func GetNowQueryTime() time.Time
- func StringInSlice(str string, list []string) bool
- func StringJoinIPWithRegex(list []string, sep, reg string) string
- func StringJoinWithRegex(list []string, sep, reg string) string
- type JSONTime
- type ListOption
Constants ¶
View Source
const ( // FSType file system type FSType = "ext[234]|btrfs|xfs|zfs" // MountPoint mount point MountPoint = "/data" )
View Source
const (
// DataTableNamePrefix xxx
DataTableNamePrefix = "bcsmonitor_"
)
View Source
const ( // QueryFallbackTime metrics 查询回退时间 QueryFallbackTime = time.Minute )
Variables ¶
This section is empty.
Functions ¶
func EnsureTable ¶
func EnsureTable(ctx context.Context, db drivers.DB, tableName string, indexes []drivers.Index) error
EnsureTable ensure object database table and table indexes
func StringInSlice ¶
StringInSlice 判断字符串是否存在 Slice 中
func StringJoinIPWithRegex ¶
StringJoinIPWithRegex 数组转化为字符串,并添加正则
func StringJoinWithRegex ¶
StringJoinWithRegex 数组转化为字符串,并添加正则
Types ¶
type JSONTime ¶
JSONTime format time in json marshal
func (*JSONTime) MarshalJSON ¶
MarshalJSON marshal json
func (*JSONTime) UnmarshalJSON ¶
UnmarshalJSON unmarshal json
type ListOption ¶
type ListOption struct { // Sort map for sort list results Sort map[string]interface{} // Page for the page number in current list Page int64 // Size for the size each page in current list Size int64 }
ListOption list option the listed data index is from page*size ~ page*size+(size-1)
Click to show internal directories.
Click to hide internal directories.