Documentation ¶
Index ¶
- Variables
- func EntGetClient() *ent.Client
- func EntGetStats() map[string]interface{}
- func EntInitSchema() error
- func EntPing() error
- func RedisGetClient() redis.UniversalClient
- func RedisIsNilError(err error) bool
- func RedisPing() error
- func RedisStats() map[string]interface{}
- func SnappyDecode(buf []byte) ([]byte, error)
- func SnappyEncode(data []byte) []byte
- type ContextKey
- type EntListParams
- type InfluxDB
- func (db *InfluxDB) Close()
- func (db *InfluxDB) GetAndResetWriteCount() int64
- func (db *InfluxDB) GetBucket() string
- func (db *InfluxDB) GetWritingCount() int32
- func (db *InfluxDB) Health() error
- func (db *InfluxDB) Query(ctx context.Context, query string) ([]map[string]interface{}, error)
- func (db *InfluxDB) Write(measurement string, tags map[string]string, fields map[string]interface{}, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRedisTooManyProcessing 处理请求太多时的出错 ErrRedisTooManyProcessing = &hes.Error{ Message: "too many processing", StatusCode: http.StatusInternalServerError, Category: "redis", } )
Functions ¶
func SnappyDecode ¶
func SnappyEncode ¶
Types ¶
type ContextKey ¶
type ContextKey struct{}
type EntListParams ¶
type EntListParams struct { // 查询limit限制 // required: true Limit int `json:"limit" validate:"required,xLimit"` // 查询的offset偏移 Offset int `json:"offset" validate:"omitempty,xOffset"` // 查询筛选的字段,如果多个字段以,分隔 Fields string `json:"fields" validate:"omitempty,xFields"` // 查询的排序字段,如果以-前缀表示降序,如果多个字段以,分隔 Order string `json:"order" validate:"omitempty,xOrder"` // 忽略计算总数,如果此字段不为空则表示不查询总数 IgnoreCount string `json:"ignoreCount"` }
EntEntListParams 公共的列表查询参数
func (*EntListParams) GetFields ¶
func (params *EntListParams) GetFields() []string
GetFields 获取选择的字段
func (*EntListParams) GetOrders ¶
func (params *EntListParams) GetOrders() []ent.OrderFunc
GetOrders 获取排序的函数列表
func (*EntListParams) ShouldCount ¶
func (params *EntListParams) ShouldCount() bool
ShouldCount 判断是否需要计算总数
type InfluxDB ¶
type InfluxDB struct {
// contains filtered or unexported fields
}
func (*InfluxDB) GetAndResetWriteCount ¶
func (*InfluxDB) GetWritingCount ¶
Click to show internal directories.
Click to hide internal directories.