Documentation
¶
Index ¶
- Constants
- Variables
- func AesCbcDecrypt(key string, iv string, src []byte) (data []byte, err error)
- func AesCbcDecryptBase64(key string, iv string, str string) (data []byte, err error)
- func AesCbcEncrypt(key string, iv string, data []byte) ([]byte, error)
- func BindParams(c *gin.Context, params interface{}) (code int, err error)
- func BindParamsWithBody(c *gin.Context, params interface{}) (code int, err error)
- func CloseDaoMongo() error
- func CloseGRpcPool()
- func CloseSkyWalking()
- func ConfigAppFailOverGet(key string) (string, error)
- func ConfigAppFailoverGet(key string) (string, error)
- func ConfigAppGet(key string) interface{}
- func ConfigAppGetSlice(key string, data interface{}) error
- func ConfigAppGetString(key string, defaultConfig string) string
- func ConfigAppGetValue[...](key string, defaultData T) T
- func ConfigAppGetValueArr[T int | int8 | int16 | int32 | int64 | string | float32 | float64 | bool](key string, defaultData []T) (ret []T)
- func ConfigCodeGetMessage(code int) string
- func ConfigDocsInstanceNameGet() string
- func ConfigEnvGet() string
- func ConfigEnvIsBeta() bool
- func ConfigEnvIsDebug() bool
- func ConfigEnvIsDev() bool
- func ConfigMongodbClusterGetDbCount() (n int)
- func ConfigMysqlClusterGetDbCount() (n int)
- func Curl(ctx context.Context, method string, url string, header map[string]string, ...) (ret []byte, err error)
- func CurlDelete(ctx context.Context, url string, header []string, timeout time.Duration) (ret []byte, err error)
- func CurlGet(ctx context.Context, url string, header []string, timeout time.Duration) (ret []byte, err error)
- func CurlPost(ctx context.Context, url string, header []string, data string, ...) (ret []byte, err error)
- func CurlPostFile(ctx context.Context, url string, reqParams map[string]string, ...) (ret []byte, err error)
- func CurlPut(ctx context.Context, url string, header []string, data string, ...) (ret []byte, err error)
- func EntrySpan(peer string, operationName string, layer v3.SpanLayer) (span go2sky.Span, subCtx context.Context, err error)
- func ExitSpan(ctx context.Context, peer string, operationName string, layer v3.SpanLayer) (span go2sky.Span, err error)
- func ExitSpanGRpc(ctx context.Context, peer string, operationName string, layer v3.SpanLayer) (span go2sky.Span, ctxValue context.Context, err error)
- func GetConfigProjectConfigsPath() (path string)
- func GoFunc(f ...func() error) (err error)
- func GoFuncOne(f func() error)
- func InitGRpcPool()
- func InitSkyWalking()
- func InjectorNull(headerKey, headerValue string) error
- func JSONDecodeUseNumber(body []byte, obj any) (err error)
- func LimitHandlerByIP(lmt *limiter.Limiter) gin.HandlerFunc
- func LimitHandlerByKey(lmt *limiter.Limiter, key string) gin.HandlerFunc
- func ListenGrpc(grpcPort string, srv *grpc.Server)
- func ListenHttp(httpPort string, r http.Handler, timeout int, f ...func())
- func LocalSpan(ctx context.Context, peer string, operationName string, layer v3.SpanLayer) (span go2sky.Span, subCtx context.Context, err error)
- func LogDPanic(logName string, args ...interface{})
- func LogDPanicf(logName string, template string, args ...interface{})
- func LogDPanicw(logName string, msg string, keysAndValues ...interface{})
- func LogDebug(logName string, args ...interface{})
- func LogDebugf(logName string, template string, args ...interface{})
- func LogDebugw(logName string, msg string, keysAndValues ...interface{})
- func LogError(logName string, args ...interface{})
- func LogErrorf(logName string, template string, args ...interface{})
- func LogErrorw(logName string, msg string, keysAndValues ...interface{})
- func LogFatal(logName string, args ...interface{})
- func LogFatalf(logName string, template string, args ...interface{})
- func LogFatalw(logName string, msg string, keysAndValues ...interface{})
- func LogInfo(logName string, args ...interface{})
- func LogInfof(logName string, template string, args ...interface{})
- func LogInfow(logName string, msg string, keysAndValues ...interface{})
- func LogPanic(logName string, args ...interface{})
- func LogPanicf(logName string, template string, args ...interface{})
- func LogPanicw(logName string, msg string, keysAndValues ...interface{})
- func LogSync()
- func LogWarn(logName string, args ...interface{})
- func LogWarnf(logName string, template string, args ...interface{})
- func LogWarnw(logName string, msg string, keysAndValues ...interface{})
- func MiddlewareGRpcUnaryInterceptorTracer() grpc.UnaryServerInterceptor
- func MiddlewareHttp() gin.HandlerFunc
- func NewGin(param ...string) *gin.Engine
- func NewLimiter(max float64, burst int, code int, msg ...string) (lmt *limiter.Limiter)
- func PKCS5Padding(cipherText []byte, blockSize int) []byte
- func PKCS5Trimming(encrypt []byte) []byte
- func PathExists(path string) (bool, error)
- func Recovery() gin.HandlerFunc
- func RedisGetAddress(conf *ConfigCacheRedis) (addr string, index int32, err error)
- func RegisterOnShutdown(f func(cancel context.CancelFunc), timeout time.Duration)
- func RunFuncName() string
- func RunFuncNameSkip(skip int) string
- func RunFuncNameUp() string
- func SetLogTimeSwitch(b bool)
- func SpanComponent(span go2sky.Span, component int32)
- func SpanEnd(span go2sky.Span)
- func SpanError(span go2sky.Span, data ...string)
- func SpanErrorFast(span go2sky.Span, err error)
- func SpanLog(span go2sky.Span, data ...string)
- func SpanTag(span go2sky.Span, key go2sky.Tag, value string)
- func SubStr(str string, start int, length int) (result string)
- func TracerDisabled() bool
- func UtilCryptoGenerateRandomToken(n int) (string, error)
- func UtilCryptoGenerateRandomToken16() (string, error)
- func UtilCryptoGenerateRandomToken32() (string, error)
- func UtilCryptoMD5(str string) string
- func UtilCryptoMD5Lower(str string) string
- func UtilCryptoMd5(s string) string
- func UtilCryptoMd5Lower(s string) string
- func UtilCryptoSha1(s string) string
- func UtilFloat64ToInt(value float64, multiplied float64) (intValue int, err error)
- func UtilGetStringArrayFromInt64Array(data []int64) []string
- func UtilGetStringArrayFromIntArray(data []int) []string
- func UtilGetStringFromInt64Array(data []int64, sep string) string
- func UtilGetStringFromIntArray(data []int, sep string) string
- func UtilGetUrlHost(urlPath string) (host string)
- func UtilIsEmpty(data string) bool
- func UtilLogDebug(msg string)
- func UtilLogDebugf(format string, a ...interface{})
- func UtilLogError(msg string)
- func UtilLogErrorf(format string, a ...interface{})
- func UtilLogInfo(msg string)
- func UtilLogInfof(format string, a ...interface{})
- func UtilMQSend(key string, data interface{}) error
- func UtilRequestGetAllParams(c *gin.Context) (ret url.Values)
- func UtilRequestGetParam(c *gin.Context, key string) string
- func UtilRequestQueryDataString(c *gin.Context) string
- func UtilResponseRedirect(c *gin.Context, url string)
- func UtilResponseReturnJson(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJson400(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJson500(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJsonFailed(c *gin.Context, code int)
- func UtilResponseReturnJsonNoP(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJsonNoPReal(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJsonReal(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJsonStatus(c *gin.Context, code int, model interface{}, msg ...string)
- func UtilResponseReturnJsonSuccess(c *gin.Context, data interface{})
- func UtilResponseReturnJsonWithMsg(c *gin.Context, code int, msg string, model interface{}, callbackFlag bool, ...)
- func UtilSignCheckSign(c *gin.Context, token string) bool
- func UtilSignCheckSignTimestamp(c *gin.Context) (ts string, b bool)
- func UtilSignGetSortUpParamsString(ps url.Values) string
- func UtilSplitToInt64Array(data string, sep string) []int64
- func UtilSplitToIntArray(data string, sep string) []int
- func UtilStringCheckStringExisted(strs []string, str string) bool
- func UtilStringConcat(buffer *bytes.Buffer, str string)
- func UtilStringConcatExist(strs []string, str string) []string
- func UtilStringContains(obj interface{}, target interface{}) bool
- func UtilStringGenerateRandomString(n int) string
- func UtilStringGenerateRandomStringNoSymbol(n int) string
- func UtilTimeConsumePrint(timeBefore time.Time, prefix string)
- func UtilTimeDiffDay(t1 time.Time, t2 time.Time) int
- func UtilTimeFewDaysLater(day int) time.Time
- func UtilTimeFewDurationLater(duration time.Duration) time.Time
- func UtilTimeGetDate(t time.Time) time.Time
- func UtilTimeIsExpired(expirationTime time.Time) bool
- func UtilTimeIsLeapYear(y int) bool
- func UtilTimeIsToday(t time.Time) bool
- func UtilTimeSameDay(t1 time.Time, t2 time.Time) bool
- func UtilTimeSixHoursLater() time.Time
- func UtilTimeTwentyFourHoursLater() time.Time
- type BaseMongo
- type BaseMongoEx
- type CacheClient
- type ConfigApp
- type ConfigCache
- type ConfigCacheDynamic
- type ConfigCacheNoProxy
- type ConfigCacheRedis
- type ConfigCodeList
- type ConfigDb
- type ConfigDbBase
- type ConfigDbPool
- type ConfigES
- type ConfigMongo
- type ConfigMysql
- func (m *ConfigMysql) GetClusterPool() *ConfigDbPool
- func (m *ConfigMysql) GetClusterRead() (config *ConfigDbBase)
- func (m *ConfigMysql) GetClusterWrite() (config *ConfigDbBase)
- func (m *ConfigMysql) GetPool() *ConfigDbPool
- func (m *ConfigMysql) GetRead() (config *ConfigDbBase)
- func (m *ConfigMysql) GetWrite() *ConfigDbBase
- type ConfigPool
- type ConfigPoolMap
- type ConfigProject
- type ConfigTracer
- type ConfigTracerData
- type ConfigTracerReporterData
- type ConfigTracerSamplerData
- type DaoES
- type DaoESFactory
- func (f *DaoESFactory) ActivateObject(object *pool.PooledObject) error
- func (f *DaoESFactory) DestroyObject(object *pool.PooledObject) error
- func (f *DaoESFactory) MakeClient() (*elastic.Client, error)
- func (f *DaoESFactory) MakeObject() (*pool.PooledObject, error)
- func (f *DaoESFactory) PassivateObject(object *pool.PooledObject) error
- func (f *DaoESFactory) ValidateObject(object *pool.PooledObject) bool
- type DaoESV5
- func (p *DaoESV5) CloseConnect(client *elastic.Client)
- func (p *DaoESV5) GetConnect() (*elastic.Client, error)
- func (p *DaoESV5) Insert(id string, data interface{}) error
- func (p *DaoESV5) Update(id string, doc interface{}) error
- func (p *DaoESV5) UpdateAppend(id string, name string, value interface{}) error
- type DaoESV5Factory
- func (f *DaoESV5Factory) ActivateObject(object *pool.PooledObject) error
- func (f *DaoESV5Factory) DestroyObject(object *pool.PooledObject) error
- func (f *DaoESV5Factory) MakeClient() (*elastic.Client, error)
- func (f *DaoESV5Factory) MakeObject() (*pool.PooledObject, error)
- func (f *DaoESV5Factory) PassivateObject(object *pool.PooledObject) error
- func (f *DaoESV5Factory) ValidateObject(object *pool.PooledObject) bool
- type DaoESV6
- func (p *DaoESV6) CloseConnect(client *elastic.Client)
- func (p *DaoESV6) GetConnect() (*elastic.Client, error)
- func (p *DaoESV6) Insert(id string, data interface{}) error
- func (p *DaoESV6) Update(id string, doc interface{}) error
- func (p *DaoESV6) UpdateAppend(id string, name string, value interface{}) error
- type DaoESV6Factory
- func (f *DaoESV6Factory) ActivateObject(object *pool.PooledObject) error
- func (f *DaoESV6Factory) DestroyObject(object *pool.PooledObject) error
- func (f *DaoESV6Factory) MakeClient() (*elastic.Client, error)
- func (f *DaoESV6Factory) MakeObject() (*pool.PooledObject, error)
- func (f *DaoESV6Factory) PassivateObject(object *pool.PooledObject) error
- func (f *DaoESV6Factory) ValidateObject(object *pool.PooledObject) bool
- type DaoESV7
- func (p *DaoESV7) AddIndexField(indexName string, data map[string]interface{}) error
- func (p *DaoESV7) Bulk(upsertData map[string]interface{}, deleteData []string) error
- func (p *DaoESV7) BulkDelete(idS []string) error
- func (p *DaoESV7) BulkUpsert(idS []string, dataS []interface{}) error
- func (p *DaoESV7) CloseConnect(client *elastic.Client)
- func (p *DaoESV7) CreateIndex(indexName string, data interface{}) error
- func (p *DaoESV7) DelIndex(indexName string) error
- func (p *DaoESV7) GetConnect() (*elastic.Client, error)
- func (p *DaoESV7) IndexPutSettings(indexName string, data interface{}) error
- func (p *DaoESV7) Insert(id string, data interface{}) error
- func (p *DaoESV7) NewIdsQuery() *elastic.IdsQuery
- func (p *DaoESV7) NewMatchAllQuery() elastic.Query
- func (p *DaoESV7) NewQueryStringQuery(str string) *elastic.QueryStringQuery
- func (p *DaoESV7) SetIndexName(indexName string)
- func (p *DaoESV7) Update(id string, doc interface{}) error
- func (p *DaoESV7) UpdateAppend(id string, value interface{}) error
- func (p *DaoESV7) Upsert(id string, doc interface{}) error
- func (p *DaoESV7) UpsertUseScript(id string, doc interface{}, script *elastic.Script) error
- type DaoGRPC
- type DaoMongo
- func (p *DaoMongo) Count(condition interface{}) (int, error)
- func (p *DaoMongo) Distinct(condition interface{}, field string) (data []interface{}, err error)
- func (p *DaoMongo) DistinctCount(condition interface{}, field string) (data []DaoMongoCountStruct, err error)
- func (p *DaoMongo) Find(condition interface{}, limit int, skip int, data interface{}, ...) error
- func (p *DaoMongo) FindOne(condition interface{}, data interface{}, sortFields bson.D) error
- func (p *DaoMongo) GetById(id interface{}, data interface{}) error
- func (p *DaoMongo) GetId() (int64, error)
- func (p *DaoMongo) GetNextSequence() (int64, error)
- func (p *DaoMongo) GetSession() (session mongo.Session, dbName string, timeout int, err error)
- func (p *DaoMongo) Insert(data IModelMongo) error
- func (p *DaoMongo) InsertM(data []IModelMongo) error
- func (p *DaoMongo) InsertMReturn(data []IModelMongo) (insertedIDs []interface{}, err error)
- func (p *DaoMongo) InsertReturn(data IModelMongo) (insertedID interface{}, err error)
- func (p *DaoMongo) RemoveAll(selector interface{}) error
- func (p *DaoMongo) RemoveId(id interface{}) error
- func (p *DaoMongo) SetEventualMode()
- func (p *DaoMongo) SetMonotonicMode()
- func (p *DaoMongo) SetNearestMode()
- func (p *DaoMongo) SetPrimaryMode()
- func (p *DaoMongo) SetPrimaryPreferredMode()
- func (p *DaoMongo) SetSecondaryMode()
- func (p *DaoMongo) SetSecondaryPreferredMode()
- func (p *DaoMongo) SetStrongMode()
- func (p *DaoMongo) Sum(condition interface{}, sumField string) (int, error)
- func (p *DaoMongo) Update(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongo) UpdateAllSupported(condition interface{}, updateData interface{}, opts ...*options.UpdateOptions) error
- func (p *DaoMongo) UpdateOne(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongo) Upsert(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongo) UpsertNum(condition interface{}, data map[string]interface{}) error
- type DaoMongoCountStruct
- type DaoMongodbCluster
- func (p *DaoMongodbCluster) Count(condition interface{}) (int, error)
- func (p *DaoMongodbCluster) Distinct(condition interface{}, field string) (data []interface{}, err error)
- func (p *DaoMongodbCluster) DistinctCount(condition interface{}, field string) (data []DaoMongoCountStruct, err error)
- func (p *DaoMongodbCluster) Find(condition interface{}, limit int, skip int, data interface{}, ...) error
- func (p *DaoMongodbCluster) FindOne(condition interface{}, data interface{}, sortFields bson.D) error
- func (p *DaoMongodbCluster) GetById(id interface{}, data interface{}) error
- func (p *DaoMongodbCluster) GetId() (int64, error)
- func (p *DaoMongodbCluster) GetNextSequence() (int64, error)
- func (p *DaoMongodbCluster) GetSession() (session mongo.Session, dbName string, timeout int, err error)
- func (p *DaoMongodbCluster) Insert(data IModelMongo) error
- func (p *DaoMongodbCluster) InsertM(data []IModelMongo) error
- func (p *DaoMongodbCluster) InsertMReturn(data []IModelMongo) (insertedIDs []interface{}, err error)
- func (p *DaoMongodbCluster) InsertReturn(data IModelMongo) (insertedID interface{}, err error)
- func (p *DaoMongodbCluster) RemoveAll(selector interface{}) error
- func (p *DaoMongodbCluster) RemoveId(id interface{}) error
- func (p *DaoMongodbCluster) Sum(condition interface{}, sumField string) (int, error)
- func (p *DaoMongodbCluster) Update(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongodbCluster) UpdateOne(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongodbCluster) Upsert(condition interface{}, data map[string]interface{}) error
- func (p *DaoMongodbCluster) UpsertNum(condition interface{}, data map[string]interface{}) error
- type DaoMysql
- func (p *DaoMysql) Find(condition string, data interface{}, skip int, limit int, fields []string, ...) error
- func (p *DaoMysql) First(condition string, data interface{}, sort string) error
- func (p *DaoMysql) GetReadOrm() (MysqlConnection, error)
- func (p *DaoMysql) GetWriteOrm() (MysqlConnection, error)
- func (p *DaoMysql) Insert(model interface{}) error
- func (p *DaoMysql) Remove(condition string) error
- func (p *DaoMysql) Select(condition string, data interface{}, field ...[]string) error
- func (p *DaoMysql) SelectWithConn(orm *MysqlConnection, condition string, data interface{}, field ...[]string) error
- func (p *DaoMysql) Update(condition string, sets map[string]interface{}) error
- type DaoMysqlCluster
- func (p *DaoMysqlCluster) Count(condition string, data int64) error
- func (p *DaoMysqlCluster) First(condition string, data interface{}) error
- func (p *DaoMysqlCluster) GetReadOrm() (MysqlConnection, error)
- func (p *DaoMysqlCluster) GetWriteOrm() (MysqlConnection, error)
- func (p *DaoMysqlCluster) GetWriteOrmNoDb() (conn MysqlConnection, err error)
- func (p *DaoMysqlCluster) Insert(model interface{}) error
- func (p *DaoMysqlCluster) Remove(condition string) error
- func (p *DaoMysqlCluster) Select(condition string, data interface{}, skip int, limit int, fields []string, ...) error
- func (p *DaoMysqlCluster) Update(condition string, sets map[string]interface{}) error
- type DaoRedis
- func (p *DaoRedis) Del(key string) bool
- func (p *DaoRedis) Exists(key string) (bool, error)
- func (p *DaoRedis) Expire(key string, expire int) bool
- func (p *DaoRedis) Get(key string, data interface{}) bool
- func (p *DaoRedis) GetE(key string, data interface{}) error
- func (p *DaoRedis) GetPTtl(key string) (ttl int64, err error)
- func (p *DaoRedis) GetRaw(key string, data interface{}) (b bool, err error)
- func (p *DaoRedis) GetRedisConn() (c redis.UniversalClient, err error)
- func (p *DaoRedis) GetTtl(key string) (ttl int64, err error)
- func (p *DaoRedis) HDel(key string, data ...interface{}) bool
- func (p *DaoRedis) HExists(key string, field string) (bool, error)
- func (p *DaoRedis) HGet(key string, field string, value interface{}) bool
- func (p *DaoRedis) HGetAll(key string, data interface{}) error
- func (p *DaoRedis) HGetAllIntMap(key string) (err error, data map[string]int64)
- func (p *DaoRedis) HGetAllStringMap(key string) (err error, data map[string]string)
- func (p *DaoRedis) HGetE(key string, field string, value interface{}) error
- func (p *DaoRedis) HGetRaw(key string, field string, value interface{}) (b bool, err error)
- func (p *DaoRedis) HIncrby(key string, field string, value int) (int, bool)
- func (p *DaoRedis) HLen(key string, data *int) bool
- func (p *DaoRedis) HMGet(key string, fields []interface{}, data interface{}) error
- func (p *DaoRedis) HMSet(key string, value map[string]interface{}) bool
- func (p *DaoRedis) HMSetE(key string, value map[string]interface{}) error
- func (p *DaoRedis) HSet(key string, field string, value interface{}) bool
- func (p *DaoRedis) HSetNX(key string, field string, value interface{}) (int64, bool)
- func (p *DaoRedis) Incr(key string) (int, bool)
- func (p *DaoRedis) IncrBy(key string, value int) (int, bool)
- func (p *DaoRedis) LLen() (int64, error)
- func (p *DaoRedis) LPop(value interface{}) bool
- func (p *DaoRedis) LPush(value interface{}) bool
- func (p *DaoRedis) LREM(count int, data interface{}) int
- func (p *DaoRedis) LRange(start int, end int, value interface{}) (err error)
- func (p *DaoRedis) LTRIM(start int, end int) (err error)
- func (p *DaoRedis) MDel(key ...string) bool
- func (p *DaoRedis) MGet(keys []string, data interface{}) error
- func (p *DaoRedis) MGetGo(keys []string, data interface{}) error
- func (p *DaoRedis) MSet(datas map[string]interface{}) bool
- func (p *DaoRedis) PipelineHGet(key []string, fields []interface{}, data []interface{}) error
- func (p *DaoRedis) Pop(value interface{}, isLeft bool) bool
- func (p *DaoRedis) Push(value interface{}, isLeft bool) bool
- func (p *DaoRedis) RPop(value interface{}) bool
- func (p *DaoRedis) RPush(value interface{}) bool
- func (p *DaoRedis) SAdd(key string, argPs []interface{}) bool
- func (p *DaoRedis) SCard(key string) int64
- func (p *DaoRedis) SIsMember(key string, arg interface{}) bool
- func (p *DaoRedis) SMembers(key string, value interface{}) (err error)
- func (p *DaoRedis) SPop(key string, value interface{}) bool
- func (p *DaoRedis) SRem(key string, argPs []interface{}) bool
- func (p *DaoRedis) Set(key string, value interface{}) bool
- func (p *DaoRedis) SetE(key string, value interface{}) error
- func (p *DaoRedis) SetEx(key string, value interface{}, expire int) bool
- func (p *DaoRedis) SetExE(key string, value interface{}, expire int) error
- func (p *DaoRedis) SetNX(key string, value interface{}) (int64, bool)
- func (p *DaoRedis) SetNXNoExpire(key string, value interface{}) (int64, bool)
- func (p *DaoRedis) ZAdd(key string, score interface{}, data interface{}) bool
- func (p *DaoRedis) ZAddM(key string, value map[string]interface{}) bool
- func (p *DaoRedis) ZCard(key string) (data int, err error)
- func (p *DaoRedis) ZCount(key string, min, max int) (data int, err error)
- func (p *DaoRedis) ZGet(key string, sort bool, start int, end int, value interface{}) error
- func (p *DaoRedis) ZGetByScore(key string, sort bool, start int, end int, value interface{}) error
- func (p *DaoRedis) ZGetWithScores(key string, sort bool, start int, end int) (err error, data map[string]string)
- func (p *DaoRedis) ZIncrBy(key string, increment int, member interface{}) bool
- func (p *DaoRedis) ZRank(key string, member string, sort bool) (bool, int)
- func (p *DaoRedis) ZRem(key string, data ...interface{}) bool
- func (p *DaoRedis) ZRevRange(key string, start int, end int, value interface{}) error
- func (p *DaoRedis) ZScore(key string, member string, value interface{}) bool
- type DaoRedisEx
- func (p *DaoRedisEx) CompareWithAdd(key string, value int, cvalue int, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) CompareWithReduce(key string, value int, cvalue int, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) Del(key string, ops ...OpOptionEx) error
- func (p *DaoRedisEx) DelWithReply(key string, ops ...OpOptionEx) (ret interface{}, err error)
- func (p *DaoRedisEx) Exists(key string, ops ...OpOptionEx) (bool, error)
- func (p *DaoRedisEx) Expire(key string, expire int, ops ...OpOptionEx) error
- func (p *DaoRedisEx) Get(key string, data interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) GetExpire(expire int) int
- func (p *DaoRedisEx) GetKey(key string) string
- func (p *DaoRedisEx) GetPTtl(key string) (ttl int64, err error)
- func (p *DaoRedisEx) GetRaw(key string, data interface{}, ops ...OpOptionEx) (bool, error)
- func (p *DaoRedisEx) GetRedisConn() (c redis.UniversalClient, err error)
- func (p *DaoRedisEx) GetTtl(key string) (ttl int64, err error)
- func (p *DaoRedisEx) HDel(key string, data ...interface{}) error
- func (p *DaoRedisEx) HExists(key string, field string) (bool, error)
- func (p *DaoRedisEx) HGet(key string, field string, value interface{}) error
- func (p *DaoRedisEx) HGetAll(key string, data interface{}) error
- func (p *DaoRedisEx) HGetAllIntMap(key string) (err error, data map[string]int64)
- func (p *DaoRedisEx) HGetAllStringMap(key string) (err error, data map[string]string)
- func (p *DaoRedisEx) HGetRaw(key string, field string, value interface{}) (bool, error)
- func (p *DaoRedisEx) HIncrby(key string, field string, value int, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) HLen(key string, data *int) error
- func (p *DaoRedisEx) HMGet(key string, fields []interface{}, data interface{}) error
- func (p *DaoRedisEx) HMSet(key string, value map[string]interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) HSet(key string, field string, value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) HSetNX(key string, field string, value interface{}, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) Incr(key string, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) IncrBy(key string, value int, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) IncrByNX(key string, value int, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) IncrByNoExpire(key string, value int) (int64, error)
- func (p *DaoRedisEx) IncrNX(key string, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) LLen() (int64, error)
- func (p *DaoRedisEx) LLenEx(key string) (int64, error)
- func (p *DaoRedisEx) LPop(value interface{}) error
- func (p *DaoRedisEx) LPopEx(key string, value interface{}) error
- func (p *DaoRedisEx) LPush(value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) LPushEx(key string, value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) LREM(count int, data interface{}) (error, int)
- func (p *DaoRedisEx) LREMEx(key string, count int, data interface{}) (error, int)
- func (p *DaoRedisEx) LRange(start int, end int, value interface{}) (err error)
- func (p *DaoRedisEx) LRangeEx(key string, start int, end int, value interface{}) (err error)
- func (p *DaoRedisEx) LTRIM(start int, end int) (err error)
- func (p *DaoRedisEx) LTRIMEx(key string, start int, end int) (err error)
- func (p *DaoRedisEx) Limiter(key string, expire int, max int) (allow bool, err error)
- func (p *DaoRedisEx) MDel(key []string, ops ...OpOptionEx) error
- func (p *DaoRedisEx) MGet(keys []string, data interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) MGetGo(keys []string, data interface{}) error
- func (p *DaoRedisEx) MSet(datas map[string]interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) Persist(key string, ops ...OpOptionEx) error
- func (p *DaoRedisEx) PipelineHGet(key []string, fields []interface{}, data []interface{}) error
- func (p *DaoRedisEx) RPop(value interface{}) error
- func (p *DaoRedisEx) RPopEx(key string, value interface{}) error
- func (p *DaoRedisEx) RPush(value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) RPushEx(key string, value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) SAdd(key string, argPs []interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) SCard(key string) int64
- func (p *DaoRedisEx) SIsMember(key string, arg interface{}) (b bool, err error)
- func (p *DaoRedisEx) SMembers(key string) (data []interface{}, err error)
- func (p *DaoRedisEx) SPop(key string, value interface{}) error
- func (p *DaoRedisEx) SRem(key string, argPs []interface{}) error
- func (p *DaoRedisEx) Set(key string, value interface{}, ops ...OpOptionEx) (err error)
- func (p *DaoRedisEx) SetEx(key string, value interface{}, expire int, ops ...OpOptionEx) error
- func (p *DaoRedisEx) SetNX(key string, value interface{}, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) SetNXNoExpire(key string, value interface{}, ops ...OpOptionEx) (int64, error)
- func (p *DaoRedisEx) ZAdd(key string, score interface{}, value interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) ZAddM(key string, value map[float64]interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) ZCard(key string) (data int, err error)
- func (p *DaoRedisEx) ZCount(key string, min, max int) (data int, err error)
- func (p *DaoRedisEx) ZGet(key string, sort bool, start int, end int, value interface{}) error
- func (p *DaoRedisEx) ZGetByScore(key string, sort bool, start int, end int, value interface{}) error
- func (p *DaoRedisEx) ZGetByScoreLimit(key string, sort bool, offset uint32, limit uint32, value interface{}) error
- func (p *DaoRedisEx) ZGetByScoreWithSize(key string, sort bool, start int, end int, offset uint32, limit uint32, ...) error
- func (p *DaoRedisEx) ZGetWithScores(key string, sort bool, start int, end int) (err error, data map[string]string)
- func (p *DaoRedisEx) ZGetWithScoresLimit(key string, sort bool, offset uint32, limit uint32) (err error, data []ModelRedisZSetListWithScore)
- func (p *DaoRedisEx) ZGetWithScoresSlice(key string, sort bool, start int, end int) (err error, data []ModelRedisZSetListWithScore)
- func (p *DaoRedisEx) ZIncrBy(key string, increment int, member interface{}, ops ...OpOptionEx) error
- func (p *DaoRedisEx) ZRank(key string, member string, sort bool) (error, int)
- func (p *DaoRedisEx) ZRem(key string, data ...interface{}) error
- func (p *DaoRedisEx) ZRevRange(key string, start int, end int, value interface{}) error
- func (p *DaoRedisEx) ZScore(key string, member string, value interface{}) error
- type EventBus
- type IModelES
- type IModelMongo
- type IModelMysql
- type Log
- type LogTime
- type ModelMongo
- type ModelMongoBase
- func (m *ModelMongoBase) ExistId() (b bool)
- func (m *ModelMongoBase) GetCreatedTime() time.Time
- func (m *ModelMongoBase) GetId() (id int64)
- func (m *ModelMongoBase) InitTime(t time.Time)
- func (m *ModelMongoBase) SetId(id int64)
- func (m *ModelMongoBase) SetObjectId()
- func (m *ModelMongoBase) SetUpdatedTime(t time.Time)
- type ModelMongoBaseEx
- func (m *ModelMongoBaseEx) ExistId() (b bool)
- func (m *ModelMongoBaseEx) GetCreatedTime() time.Time
- func (m *ModelMongoBaseEx) GetId() (id int64)
- func (m *ModelMongoBaseEx) InitTime(t time.Time)
- func (m *ModelMongoBaseEx) SetId(id int64)
- func (m *ModelMongoBaseEx) SetObjectId()
- func (m *ModelMongoBaseEx) SetUpdatedTime(t time.Time)
- type ModelMongoEx
- func (m *ModelMongoEx) ExistId() (b bool)
- func (m *ModelMongoEx) GetCreatedTime() time.Time
- func (m *ModelMongoEx) GetId() int64
- func (m *ModelMongoEx) InitTime(t time.Time)
- func (m *ModelMongoEx) SetId(id int64)
- func (m *ModelMongoEx) SetObjectId()
- func (m *ModelMongoEx) SetUpdatedTime(t time.Time)
- type ModelMysql
- type ModelRedisZSetListWithScore
- type MysqlConnection
- type Nacos
- type OnShutdownF
- type OpOptionEx
- type RedisDynamicAddress
- type UploadFile
Constants ¶
const ( MongoReadModePrimary = "Primary" MongoReadModePrimaryPreferred = "PrimaryPreferred" MongoReadModeSecondary = "Secondary" MongoReadModeSecondaryPreferred = "SecondaryPreferred" MongoReadModeNearest = "Nearest" MongoReadModeEventual = "Eventual" MongoReadModeMonotonic = "Monotonic" MongoReadModeStrong = "Strong" )
const ( LogNameDefault = "default" LogNameRedis = "redis" LogNameMysql = "mysql" LogNameMongodb = "mongodb" LogNameApi = "api" LogNameAo = "ao" LogNameGRpc = "grpc" LogNameEs = "es" LogNameTmq = "tmq" LogNameAmq = "amq" LogNameLogic = "logic" LogNameFile = "file" LogNameNet = "net" )
const ( LogKNameCommonErr = "log-common-err" LogKNameCommonFields = "log-common-fields" LogKNameCommonCondition = "log-common-condition" LogKNameCommonAddress = "log-common-address" LogKNameCommonName = "log-common-name" LogKNameCommonCmd = "log-common-cmd" LogKNameCommonData = "log-common-data" LogKNameCommonDataType = "log-common-data-type" LogKNameCommonKey = "log-common-key" LogKNameCommonValue = "log-common-value" LogKNameCommonUrl = "log-common-url" LogKNameCommonNum = "log-common-num" LogKNameCommonId = "log-common-id" LogKNameCommonUid = "log-common-uid" LogKNameCommonCode = "log-common-code" LogKNameCommonLevel = "log-common-level" LogKNameCommonCookie = "log-common-cookie" LogKNameCommonReq = "log-common-req" LogKNameCommonRes = "log-common-res" LogKNameCommonTime = "log-common-time" LogKNameCommonTenantId = "log-common-tenant-id" LogKNameCommonRecordId = "log-common-record-id" LogKNameCommonUniqueId = "log-common-unique-id" LogKNameRedisKey = "log-redis-key" LogKNameRedisData = "log-redis-data" LogKNameMysqlParam = "log-mysql-param" LogKNameMysqlData = "log-mysql-data" LogKNameMongodbParam = "log-mongodb-param" LogKNameMongodbData = "log-mongodb-data" LogKNameApiParam = "log-api-param" LogKNameApiUrl = "log-api-url" LogKNameApiRes = "log-api-res" LogKNameAoParam = "log-ao-param" LogKNameAoReq = "log-ao-req" LogKNameAoRes = "log-ao-res" LogKNameGRpcReq = "log-grpc-req" LogKNameGRpcRes = "log-grpc-res" LogKNameEsReq = "log-es-req" LogKNameEsRes = "log-es-res" LogKNameTmqTopic = "log-tmq-topic" LogKNameTmqReq = "log-tmq-req" LogKNameTmqRes = "log-tmq-res" )
const ( PConstCodeOK = 0 //成功 PConstCodeCommonOK = 1001 //成功 PConstCodeAccessFail = 1002 //无权访问 PConstCodeServerBusy = 1003 //服务器繁忙 PConstCodeParamsIncomplete = 1004 //参数不全 PConstCodeUserNoLogin = 1005 //用户未登录 PConstCodeUserNoLoginApp = 1024 //APP用户未登录 PConstCodeBusinessError = 1010 //业务方错误 )
公共code 0 - 10000
const ( //server 节点 SpanGRpcServer = "GRpcServer" SpanHttpServer = "HttpServer" SpanScriptServer = "ScriptServer" //service 节点 SpanServiceOpen = "ServiceOpen" //公开逻辑 SpanServiceBase = "ServiceBase" //基础逻辑 //middleware 节点 SpanMiddlewareLogic = "MiddlewareLogic" //dao 节点 SpanDaoMysql = "DaoMySQL" SpanDaoRedis = "DaoRedis" SpanDaoMongoDb = "DaoMongoDB" SpanDaoApi = "DaoAPI" SpanDaoAo = "DaoAO" SpanDaoEs = "DaoES" SpanDaoGRpc = "DaoGRpc" SpanDaoMQ = "DaoMQ" )
const ( TracerSw8 = propagation.Header TracerSw8C = propagation.HeaderCorrelation )
const ( TracerSpanLayerUnknown = v3.SpanLayer_Unknown TracerSpanLayerDatabase = v3.SpanLayer_Database TracerSpanLayerRPCFramework = v3.SpanLayer_RPCFramework TracerSpanLayerHttp = v3.SpanLayer_Http TracerSpanLayerMQ = v3.SpanLayer_MQ TracerSpanLayerCache = v3.SpanLayer_Cache )
span layer
const ( SignVersionOld = 1 SignVersionNew = 2 SignVersionNewPrefix = "1_" )
const ( Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#$%&*+=?@^_|-" LettersNoSymbol = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" )
const (
ComponentIDX int32 = 5000 + iota
)
组件ID Golang程序使用范围是[5000, 6000)
const (
CurlHeaderKeyContentType = "Content-Type"
)
Variables ¶
var ( GReporter go2sky.Reporter GTracer *go2sky.Tracer )
var (
RollBus = NewEventBus(20)
)
Functions ¶
func AesCbcDecrypt ¶
解密数据
func AesCbcDecryptBase64 ¶
func BindParamsWithBody ¶
func CloseDaoMongo ¶
func CloseDaoMongo() error
func CloseGRpcPool ¶
func CloseGRpcPool()
func CloseSkyWalking ¶
func CloseSkyWalking()
func ConfigAppFailOverGet ¶
func ConfigAppFailoverGet ¶
func ConfigAppGet ¶
func ConfigAppGet(key string) interface{}
func ConfigAppGetSlice ¶
ConfigAppGetSlice 获取slice配置,data必须是指针slice *[],目前支持string,int,int64,bool,float64,float32
func ConfigAppGetString ¶
func ConfigAppGetValue ¶
func ConfigAppGetValueArr ¶
func ConfigCodeGetMessage ¶
func ConfigDocsInstanceNameGet ¶
func ConfigDocsInstanceNameGet() string
func ConfigEnvGet ¶
func ConfigEnvGet() string
func ConfigEnvIsBeta ¶
func ConfigEnvIsBeta() bool
func ConfigEnvIsDebug ¶
func ConfigEnvIsDebug() bool
func ConfigEnvIsDev ¶
func ConfigEnvIsDev() bool
func ConfigMongodbClusterGetDbCount ¶
func ConfigMongodbClusterGetDbCount() (n int)
func ConfigMysqlClusterGetDbCount ¶
func ConfigMysqlClusterGetDbCount() (n int)
func CurlDelete ¶
func CurlPostFile ¶
func ExitSpanGRpc ¶
func ExitSpanGRpc(ctx context.Context, peer string, operationName string, layer v3.SpanLayer) (span go2sky.Span, ctxValue context.Context, err error)
放数据到header内
func GetConfigProjectConfigsPath ¶
func GetConfigProjectConfigsPath() (path string)
func InjectorNull ¶
func JSONDecodeUseNumber ¶
JSONDecodeUseNumber 解析json,舍弃科学计数法
func LimitHandlerByKey ¶
func LimitHandlerByKey(lmt *limiter.Limiter, key string) gin.HandlerFunc
按照key限流
func ListenGrpc ¶
func LogDPanic ¶
func LogDPanic(logName string, args ...interface{})
LogDPanic dpanic debug模式下 当前协程panic
func LogDPanicf ¶
func LogDPanicw ¶
func MiddlewareGRpcUnaryInterceptorTracer ¶
func MiddlewareGRpcUnaryInterceptorTracer() grpc.UnaryServerInterceptor
func MiddlewareHttp ¶
func MiddlewareHttp() gin.HandlerFunc
func NewLimiter ¶
创建一个限制器 max 每秒产生令牌数 burst 令牌桶容量,用于处理突发请求 code 限制提示code msg 限制提示信息
func PathExists ¶
func Recovery ¶
func Recovery() gin.HandlerFunc
func RedisGetAddress ¶
func RedisGetAddress(conf *ConfigCacheRedis) (addr string, index int32, err error)
func RegisterOnShutdown ¶
func RegisterOnShutdown(f func(cancel context.CancelFunc), timeout time.Duration)
func RunFuncNameSkip ¶
func SetLogTimeSwitch ¶
func SetLogTimeSwitch(b bool)
func SpanComponent ¶
func SpanErrorFast ¶
func TracerDisabled ¶
func TracerDisabled() bool
func UtilCryptoMD5 ¶
func UtilCryptoMD5Lower ¶
func UtilCryptoMd5 ¶
func UtilCryptoMd5Lower ¶
func UtilCryptoSha1 ¶
func UtilFloat64ToInt ¶
func UtilGetUrlHost ¶
func UtilIsEmpty ¶
func UtilLogDebug ¶
func UtilLogDebug(msg string)
func UtilLogDebugf ¶
func UtilLogDebugf(format string, a ...interface{})
func UtilLogError ¶
func UtilLogError(msg string)
func UtilLogErrorf ¶
func UtilLogErrorf(format string, a ...interface{})
func UtilLogInfo ¶
func UtilLogInfo(msg string)
func UtilLogInfof ¶
func UtilLogInfof(format string, a ...interface{})
func UtilMQSend ¶
func UtilResponseRedirect ¶
func UtilResponseReturnJson ¶
func UtilSignCheckSignTimestamp ¶
检测请求时间是否有效
func UtilSignGetSortUpParamsString ¶
升序排序的参数拼接的字符串
func UtilSplitToInt64Array ¶
func UtilSplitToIntArray ¶
func UtilStringConcat ¶
func UtilStringConcatExist ¶
func UtilStringContains ¶
func UtilStringContains(obj interface{}, target interface{}) bool
func UtilTimeConsumePrint ¶
UtilTimeConsumePrint print time consume
func UtilTimeFewDaysLater ¶
func UtilTimeIsExpired ¶
func UtilTimeIsLeapYear ¶
func UtilTimeIsToday ¶
func UtilTimeSixHoursLater ¶
Types ¶
type BaseMongoEx ¶
type CacheClient ¶
type CacheClient struct {
// contains filtered or unexported fields
}
type ConfigCache ¶
type ConfigCache struct {
Redis ConfigCacheRedis `yaml:"Redis"`
RedisP ConfigCacheRedis `yaml:"RedisP"` // 持久化Redis
Dynamic ConfigCacheDynamic `yaml:"Dynamic"`
NoProxy ConfigCacheNoProxy `yaml:"NoProxy"` // 平台去代理模式
}
type ConfigCacheDynamic ¶
type ConfigCacheDynamic struct {
IsDynamic bool `yaml:"IsDynamic"` //是否开启代理
DynamicAddress string `yaml:"DynamicAddress"` //代理地址
CycleTime int `yaml:"CycleTime"` //循环获取时间 秒
CycleFlagTime int `yaml:"CycleFlagTime"`
}
func ConfigCacheGetRedisDynamic ¶
func ConfigCacheGetRedisDynamic() *ConfigCacheDynamic
type ConfigCacheNoProxy ¶
type ConfigCacheNoProxy struct {
IsNoProxy bool `yaml:"IsNoProxy"` //是否开启代理
ServiceAddress string `yaml:"ServiceAddress"` //获取服务地址
MonitorAddress string `yaml:"MonitorAddress"` //监控上报地址
Lang string `yaml:"Lang"` //lang
AppCode string `yaml:"AppCode"` //app code
Iv string `yaml:"Iv"` //iv
MonitorTime int `yaml:"MonitorTime"` //心跳时间 秒
}
type ConfigCacheRedis ¶
type ConfigCacheRedis struct {
Address []string `yaml:"Address"` //多个ip节点,每个都是单独访问,循环建立连接
Bid string `yaml:"Bid"` //bid
Prefix string `yaml:"Prefix"` //前缀
Cluster bool `yaml:"Cluster"` //是否集群模式 集群模式走不一样的初始化和curd
Expire int `yaml:"Expire"` // 缓存默认时间
ReadTimeout int `yaml:"ReadTimeout"` //读超时时间
WriteTimeout int `yaml:"WriteTimeout"` //写超时时间
ConnectTimeout int `yaml:"ConnectTimeout"` //建立连接的超时时间
PoolMaxActive int `yaml:"PoolMaxActive"` //池子最大连接数
PoolMinActive int `yaml:"PoolMinActive"` //池子空闲连接数
PoolIdleTimeout int `yaml:"PoolIdleTimeout"` //连接存活时间 超出时间后 连接会重置 要小于服务端链接存活时间
Password string `yaml:"Password"`
// contains filtered or unexported fields
}
func ConfigCacheGetRedis ¶
func ConfigCacheGetRedis() *ConfigCacheRedis
func ConfigCacheGetRedisBaseWithConn ¶
func ConfigCacheGetRedisBaseWithConn(persistent bool) *ConfigCacheRedis
func ConfigCacheGetRedisWithConn ¶
func ConfigCacheGetRedisWithConn(persistent bool) *ConfigCacheRedis
type ConfigCodeList ¶
type ConfigDb ¶
type ConfigDb struct {
Mysql ConfigMysql `yaml:"Mysql"`
Mongo ConfigMongo `yaml:"Mongo"`
}
func NewConfigDb ¶
func NewConfigDb() *ConfigDb
type ConfigDbBase ¶
type ConfigDbPool ¶
type ConfigES ¶
type ConfigES struct {
Address []string `yaml:"Address"`
Timeout int `yaml:"Timeout"`
TransportMaxIdel int `yaml:"TransportMaxIdel"`
HealthcheckEnabled bool `yaml:"HealthcheckEnabled"`
HealthcheckTimeout int `yaml:"HealthcheckTimeout"`
HealthcheckInterval int `yaml:"HealthcheckInterval"`
SnifferEnabled bool `yaml:"SnifferEnabled"`
Account string `yaml:"Account"`
Password string `yaml:"Password"`
}
type ConfigMongo ¶
type ConfigMongo struct {
DbNum uint32 `yaml:"DbNum"` //库号
DbName string `yaml:"DbName"` //库名
Options string `yaml:"Options"` //options
User string `yaml:"User"` //用户名
Password string `yaml:"Password"` //密码
Servers string `yaml:"Servers"` //服务ip端口
ReadOption string `yaml:"ReadOption"` //读取模式
Timeout int `yaml:"Timeout"` //具体操作超时时间 秒
MaxPoolSize uint64 `yaml:"MaxPoolSize"` //最大连接数
MinPoolSize uint64 `yaml:"MinPoolSize"` //最小连接数
SocketTimeout int `yaml:"SocketTimeout"` //读取写入超时
ConnectTimeout int `yaml:"ConnectTimeout"` //链接超时时间 默认30s
MaxConnIdleTime int `yaml:"MaxConnIdleTime"` //最大空闲时间
ServerSelectionTimeout int `yaml:"ServerSelectionTimeout"` //节点选择超时时间 默认30s
}
func ConfigMongodbClusterGetOne ¶
func ConfigMongodbClusterGetOne(dbNum uint32) (data *ConfigMongo, ok bool)
func (*ConfigMongo) Get ¶
func (m *ConfigMongo) Get() *ConfigMongo
type ConfigMysql ¶
type ConfigMysql struct {
DbNum uint32 `yaml:"DbNum"` //库号
DbName string `yaml:"DbName"` //库名
Pool ConfigDbPool `yaml:"Pool"` //连接池配置
Write ConfigDbBase `yaml:"Write"` //写库配置
Reads []ConfigDbBase `yaml:"Reads"` //读库配置
}
func ConfigMysqlClusterGetOne ¶
func ConfigMysqlClusterGetOne(dbNum uint32) (data *ConfigMysql, ok bool)
func NewConfigMysql ¶
func NewConfigMysql() *ConfigMysql
func (*ConfigMysql) GetClusterPool ¶
func (m *ConfigMysql) GetClusterPool() *ConfigDbPool
func (*ConfigMysql) GetClusterRead ¶
func (m *ConfigMysql) GetClusterRead() (config *ConfigDbBase)
func (*ConfigMysql) GetClusterWrite ¶
func (m *ConfigMysql) GetClusterWrite() (config *ConfigDbBase)
func (*ConfigMysql) GetPool ¶
func (m *ConfigMysql) GetPool() *ConfigDbPool
func (*ConfigMysql) GetRead ¶
func (m *ConfigMysql) GetRead() (config *ConfigDbBase)
func (*ConfigMysql) GetWrite ¶
func (m *ConfigMysql) GetWrite() *ConfigDbBase
type ConfigPool ¶
type ConfigPool struct {
Address []string `yaml:"Address"`
MaxIdle int `yaml:"MaxIdle"` //最大空闲
MaxActive int `yaml:"MaxActive"` //最多链接限制数 0 不限制
MaxConcurrentStreams int `yaml:"MaxConcurrentStreams"` //每一个http链接 并发stream数
Reuse bool `yaml:"Reuse"` //是否重用链接
}
func (*ConfigPool) GetAddressRandom ¶
func (c *ConfigPool) GetAddressRandom() (server string, err error)
func GetAddressRandom get one address random
type ConfigPoolMap ¶
type ConfigPoolMap struct {
Configs map[string]ConfigPool `yaml:"Configs"`
}
type ConfigProject ¶
type ConfigProject struct {
Base struct {
Mode string `yaml:"mode"`
Format string `yaml:"format"`
ConfigsPath string `yaml:"configs_path"`
} `yaml:"base"`
Nacos struct {
Addr string `yaml:"addr"`
Port uint64 `yaml:"port"`
NamespaceId string `yaml:"namespace_id"`
Group string `yaml:"group"`
DataId []string `yaml:"data_id"`
TimeoutMs uint64 `yaml:"timeout_ms"`
LogLevel string `yaml:"log_level"`
Username string `yaml:"username"`
Password string `yaml:"password"`
Interval int `yaml:"interval"`
} `yaml:"nacos"`
Log struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Debug bool `yaml:"debug"`
MaxSize int `yaml:"max_size"`
MaxAge int `yaml:"max_age"`
MaxBackups int `yaml:"max_backups"`
Compress bool `yaml:"compress"`
} `yaml:"log"`
}
type ConfigTracer ¶
type ConfigTracer struct {
Tracer ConfigTracerData `yaml:"Tracer"`
}
var (
TracerConfig *ConfigTracer
)
type ConfigTracerData ¶
type ConfigTracerData struct {
ServiceName string `yaml:"ServiceName"`
Disabled bool `yaml:"Disabled"`
Sampler ConfigTracerSamplerData `yaml:"Sampler"`
Reporter ConfigTracerReporterData `yaml:"Reporter"`
}
type ConfigTracerSamplerData ¶
type ConfigTracerSamplerData struct {
SamplingRate float64 `yaml:"SamplingRate"`
}
type DaoES ¶
func (*DaoES) CloseConnect ¶
type DaoESFactory ¶
type DaoESFactory struct {
}
func (*DaoESFactory) ActivateObject ¶
func (f *DaoESFactory) ActivateObject(object *pool.PooledObject) error
func (*DaoESFactory) DestroyObject ¶
func (f *DaoESFactory) DestroyObject(object *pool.PooledObject) error
func (*DaoESFactory) MakeClient ¶
func (f *DaoESFactory) MakeClient() (*elastic.Client, error)
func (*DaoESFactory) MakeObject ¶
func (f *DaoESFactory) MakeObject() (*pool.PooledObject, error)
func (*DaoESFactory) PassivateObject ¶
func (f *DaoESFactory) PassivateObject(object *pool.PooledObject) error
func (*DaoESFactory) ValidateObject ¶
func (f *DaoESFactory) ValidateObject(object *pool.PooledObject) bool
type DaoESV5 ¶
func (*DaoESV5) CloseConnect ¶
type DaoESV5Factory ¶
type DaoESV5Factory struct {
}
func (*DaoESV5Factory) ActivateObject ¶
func (f *DaoESV5Factory) ActivateObject(object *pool.PooledObject) error
func (*DaoESV5Factory) DestroyObject ¶
func (f *DaoESV5Factory) DestroyObject(object *pool.PooledObject) error
func (*DaoESV5Factory) MakeClient ¶
func (f *DaoESV5Factory) MakeClient() (*elastic.Client, error)
func (*DaoESV5Factory) MakeObject ¶
func (f *DaoESV5Factory) MakeObject() (*pool.PooledObject, error)
func (*DaoESV5Factory) PassivateObject ¶
func (f *DaoESV5Factory) PassivateObject(object *pool.PooledObject) error
func (*DaoESV5Factory) ValidateObject ¶
func (f *DaoESV5Factory) ValidateObject(object *pool.PooledObject) bool
type DaoESV6 ¶
func (*DaoESV6) CloseConnect ¶
type DaoESV6Factory ¶
type DaoESV6Factory struct {
}
func (*DaoESV6Factory) ActivateObject ¶
func (f *DaoESV6Factory) ActivateObject(object *pool.PooledObject) error
func (*DaoESV6Factory) DestroyObject ¶
func (f *DaoESV6Factory) DestroyObject(object *pool.PooledObject) error
func (*DaoESV6Factory) MakeClient ¶
func (f *DaoESV6Factory) MakeClient() (*elastic.Client, error)
func (*DaoESV6Factory) MakeObject ¶
func (f *DaoESV6Factory) MakeObject() (*pool.PooledObject, error)
func (*DaoESV6Factory) PassivateObject ¶
func (f *DaoESV6Factory) PassivateObject(object *pool.PooledObject) error
func (*DaoESV6Factory) ValidateObject ¶
func (f *DaoESV6Factory) ValidateObject(object *pool.PooledObject) bool
type DaoESV7 ¶
func (*DaoESV7) AddIndexField ¶
func (*DaoESV7) BulkDelete ¶
func (*DaoESV7) BulkUpsert ¶
func (*DaoESV7) CloseConnect ¶
func (*DaoESV7) CreateIndex ¶
func (*DaoESV7) IndexPutSettings ¶
func (*DaoESV7) NewIdsQuery ¶
func (*DaoESV7) NewMatchAllQuery ¶
func (*DaoESV7) NewQueryStringQuery ¶
func (p *DaoESV7) NewQueryStringQuery(str string) *elastic.QueryStringQuery
func (*DaoESV7) SetIndexName ¶
func (*DaoESV7) UpdateAppend ¶
type DaoMongo ¶
type DaoMongo struct {
CollectionName string
AutoIncrementId bool
PrimaryKey string
Mode string
Ctx context.Context
}
func NewDaoMongo ¶
func NewDaoMongo() *DaoMongo
func (*DaoMongo) DistinctCount ¶
func (p *DaoMongo) DistinctCount(condition interface{}, field string) (data []DaoMongoCountStruct, err error)
func (*DaoMongo) GetNextSequence ¶
func (*DaoMongo) GetSession ¶
func (*DaoMongo) Insert ¶
func (p *DaoMongo) Insert(data IModelMongo) error
func (*DaoMongo) InsertM ¶
func (p *DaoMongo) InsertM(data []IModelMongo) error
func (*DaoMongo) InsertMReturn ¶
func (p *DaoMongo) InsertMReturn(data []IModelMongo) (insertedIDs []interface{}, err error)
func (*DaoMongo) InsertReturn ¶
func (p *DaoMongo) InsertReturn(data IModelMongo) (insertedID interface{}, err error)
func (*DaoMongo) SetEventualMode ¶
func (p *DaoMongo) SetEventualMode()
func (*DaoMongo) SetMonotonicMode ¶
func (p *DaoMongo) SetMonotonicMode()
func (*DaoMongo) SetNearestMode ¶
func (p *DaoMongo) SetNearestMode()
func (*DaoMongo) SetPrimaryMode ¶
func (p *DaoMongo) SetPrimaryMode()
func (*DaoMongo) SetPrimaryPreferredMode ¶
func (p *DaoMongo) SetPrimaryPreferredMode()
func (*DaoMongo) SetSecondaryMode ¶
func (p *DaoMongo) SetSecondaryMode()
func (*DaoMongo) SetSecondaryPreferredMode ¶
func (p *DaoMongo) SetSecondaryPreferredMode()
func (*DaoMongo) SetStrongMode ¶
func (p *DaoMongo) SetStrongMode()
func (*DaoMongo) UpdateAllSupported ¶
func (p *DaoMongo) UpdateAllSupported(condition interface{}, updateData interface{}, opts ...*options.UpdateOptions) error
type DaoMongoCountStruct ¶
type DaoMongoCountStruct struct {
Field interface{} `bson:"_id"` //分组字段 - 可以是各种类型
Count int `bson:"count"` //计数
}
type DaoMongodbCluster ¶
type DaoMongodbCluster struct {
DbExtName string //库扩展
TableExtName string //表扩展
DbSelector uint32 //库号
DaoMongo
}
func NewDaoMongodbCluster ¶
func NewDaoMongodbCluster() *DaoMongodbCluster
func (*DaoMongodbCluster) Count ¶
func (p *DaoMongodbCluster) Count(condition interface{}) (int, error)
func (*DaoMongodbCluster) Distinct ¶
func (p *DaoMongodbCluster) Distinct(condition interface{}, field string) (data []interface{}, err error)
Distinct 只返回field的字段
func (*DaoMongodbCluster) DistinctCount ¶
func (p *DaoMongodbCluster) DistinctCount(condition interface{}, field string) (data []DaoMongoCountStruct, err error)
func (*DaoMongodbCluster) FindOne ¶
func (p *DaoMongodbCluster) FindOne(condition interface{}, data interface{}, sortFields bson.D) error
func (*DaoMongodbCluster) GetById ¶
func (p *DaoMongodbCluster) GetById(id interface{}, data interface{}) error
func (*DaoMongodbCluster) GetId ¶
func (p *DaoMongodbCluster) GetId() (int64, error)
func (*DaoMongodbCluster) GetNextSequence ¶
func (p *DaoMongodbCluster) GetNextSequence() (int64, error)
func (*DaoMongodbCluster) GetSession ¶
func (*DaoMongodbCluster) Insert ¶
func (p *DaoMongodbCluster) Insert(data IModelMongo) error
func (*DaoMongodbCluster) InsertM ¶
func (p *DaoMongodbCluster) InsertM(data []IModelMongo) error
func (*DaoMongodbCluster) InsertMReturn ¶
func (p *DaoMongodbCluster) InsertMReturn(data []IModelMongo) (insertedIDs []interface{}, err error)
func (*DaoMongodbCluster) InsertReturn ¶
func (p *DaoMongodbCluster) InsertReturn(data IModelMongo) (insertedID interface{}, err error)
func (*DaoMongodbCluster) RemoveAll ¶
func (p *DaoMongodbCluster) RemoveAll(selector interface{}) error
func (*DaoMongodbCluster) RemoveId ¶
func (p *DaoMongodbCluster) RemoveId(id interface{}) error
func (*DaoMongodbCluster) Sum ¶
func (p *DaoMongodbCluster) Sum(condition interface{}, sumField string) (int, error)
func (*DaoMongodbCluster) Update ¶
func (p *DaoMongodbCluster) Update(condition interface{}, data map[string]interface{}) error
func (*DaoMongodbCluster) UpdateOne ¶
func (p *DaoMongodbCluster) UpdateOne(condition interface{}, data map[string]interface{}) error
func (*DaoMongodbCluster) Upsert ¶
func (p *DaoMongodbCluster) Upsert(condition interface{}, data map[string]interface{}) error
func (*DaoMongodbCluster) UpsertNum ¶
func (p *DaoMongodbCluster) UpsertNum(condition interface{}, data map[string]interface{}) error
type DaoMysql ¶
func NewDaoMysql ¶
func NewDaoMysql() *DaoMysql
func (*DaoMysql) GetReadOrm ¶
func (p *DaoMysql) GetReadOrm() (MysqlConnection, error)
func (*DaoMysql) GetWriteOrm ¶
func (p *DaoMysql) GetWriteOrm() (MysqlConnection, error)
func (*DaoMysql) SelectWithConn ¶
func (p *DaoMysql) SelectWithConn(orm *MysqlConnection, condition string, data interface{}, field ...[]string) error
SelectWithConn SelectWithConn 事务的时候使用
type DaoMysqlCluster ¶
type DaoMysqlCluster struct {
DbExtName string //库扩展
TableExtName string //表扩展
TableName string //表名
DbSelector uint32 //库号
Ctx context.Context
}
func NewDaoMysqlCluster ¶
func NewDaoMysqlCluster() *DaoMysqlCluster
func (*DaoMysqlCluster) First ¶
func (p *DaoMysqlCluster) First(condition string, data interface{}) error
func (*DaoMysqlCluster) GetReadOrm ¶
func (p *DaoMysqlCluster) GetReadOrm() (MysqlConnection, error)
func (*DaoMysqlCluster) GetWriteOrm ¶
func (p *DaoMysqlCluster) GetWriteOrm() (MysqlConnection, error)
func (*DaoMysqlCluster) GetWriteOrmNoDb ¶
func (p *DaoMysqlCluster) GetWriteOrmNoDb() (conn MysqlConnection, err error)
func (*DaoMysqlCluster) Insert ¶
func (p *DaoMysqlCluster) Insert(model interface{}) error
func (*DaoMysqlCluster) Remove ¶
func (p *DaoMysqlCluster) Remove(condition string) error
type DaoRedis ¶
func (*DaoRedis) GetRedisConn ¶
func (p *DaoRedis) GetRedisConn() (c redis.UniversalClient, err error)
GetRedisConn 获取redis连接
func (*DaoRedis) HGetAllIntMap ¶
func (*DaoRedis) HGetAllStringMap ¶
func (*DaoRedis) PipelineHGet ¶
func (*DaoRedis) SetNXNoExpire ¶
func (*DaoRedis) ZGetByScore ¶
func (*DaoRedis) ZGetWithScores ¶
type DaoRedisEx ¶
type DaoRedisEx struct {
KeyName string
Persistent bool // 持久化key
ExpireSecond int // 默认过期时间,单实例有效
Ctx context.Context // 必须定义 否则报错
// contains filtered or unexported fields
}
func (*DaoRedisEx) CompareWithAdd ¶
func (p *DaoRedisEx) CompareWithAdd(key string, value int, cvalue int, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) CompareWithReduce ¶
func (p *DaoRedisEx) CompareWithReduce(key string, value int, cvalue int, ops ...OpOptionEx) (int64, error)
存在key, 减值,不能小于0(专用于扣减原子性)
func (*DaoRedisEx) Del ¶
func (p *DaoRedisEx) Del(key string, ops ...OpOptionEx) error
func (*DaoRedisEx) DelWithReply ¶
func (p *DaoRedisEx) DelWithReply(key string, ops ...OpOptionEx) (ret interface{}, err error)
func (*DaoRedisEx) Exists ¶
func (p *DaoRedisEx) Exists(key string, ops ...OpOptionEx) (bool, error)
func (*DaoRedisEx) Expire ¶
func (p *DaoRedisEx) Expire(key string, expire int, ops ...OpOptionEx) error
Expire expire
func (*DaoRedisEx) Get ¶
func (p *DaoRedisEx) Get(key string, data interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) GetExpire ¶
func (p *DaoRedisEx) GetExpire(expire int) int
func (*DaoRedisEx) GetKey ¶
func (p *DaoRedisEx) GetKey(key string) string
func (*DaoRedisEx) GetPTtl ¶
func (p *DaoRedisEx) GetPTtl(key string) (ttl int64, err error)
GetPTtl:获取key的过期时间,单位为毫秒 如果key不存在返回-2 如果key存在,但是没有设置过期时间,返回-1
func (*DaoRedisEx) GetRaw ¶
func (p *DaoRedisEx) GetRaw(key string, data interface{}, ops ...OpOptionEx) (bool, error)
返回 1. key是否存在 2. error
func (*DaoRedisEx) GetRedisConn ¶
func (p *DaoRedisEx) GetRedisConn() (c redis.UniversalClient, err error)
GetRedisConn 获取redis连接
func (*DaoRedisEx) GetTtl ¶
func (p *DaoRedisEx) GetTtl(key string) (ttl int64, err error)
GetTtl:获取key的过期时间,单位为秒 如果key不存在返回-2 如果key存在,但是没有设置过期时间,返回-1
func (*DaoRedisEx) HDel ¶
func (p *DaoRedisEx) HDel(key string, data ...interface{}) error
func (*DaoRedisEx) HGet ¶
func (p *DaoRedisEx) HGet(key string, field string, value interface{}) error
func (*DaoRedisEx) HGetAll ¶
func (p *DaoRedisEx) HGetAll(key string, data interface{}) error
func (*DaoRedisEx) HGetAllIntMap ¶
func (p *DaoRedisEx) HGetAllIntMap(key string) (err error, data map[string]int64)
func (*DaoRedisEx) HGetAllStringMap ¶
func (p *DaoRedisEx) HGetAllStringMap(key string) (err error, data map[string]string)
func (*DaoRedisEx) HGetRaw ¶
func (p *DaoRedisEx) HGetRaw(key string, field string, value interface{}) (bool, error)
HGetRaw 返回 1. key是否存在 2. error
func (*DaoRedisEx) HIncrby ¶
func (p *DaoRedisEx) HIncrby(key string, field string, value int, ops ...OpOptionEx) (int64, error)
hash start
func (*DaoRedisEx) HMGet ¶
func (p *DaoRedisEx) HMGet(key string, fields []interface{}, data interface{}) error
func (*DaoRedisEx) HMSet ¶
func (p *DaoRedisEx) HMSet(key string, value map[string]interface{}, ops ...OpOptionEx) error
HMSet value是filed:data
func (*DaoRedisEx) HSet ¶
func (p *DaoRedisEx) HSet(key string, field string, value interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) HSetNX ¶
func (p *DaoRedisEx) HSetNX(key string, field string, value interface{}, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) Incr ¶
func (p *DaoRedisEx) Incr(key string, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) IncrBy ¶
func (p *DaoRedisEx) IncrBy(key string, value int, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) IncrByNX ¶
func (p *DaoRedisEx) IncrByNX(key string, value int, ops ...OpOptionEx) (int64, error)
存在key 才会更新数值
func (*DaoRedisEx) IncrByNoExpire ¶
func (p *DaoRedisEx) IncrByNoExpire(key string, value int) (int64, error)
不操作过期时间 deprecated
func (*DaoRedisEx) IncrNX ¶
func (p *DaoRedisEx) IncrNX(key string, ops ...OpOptionEx) (int64, error)
存在key 才会自增
func (*DaoRedisEx) LLen ¶
func (p *DaoRedisEx) LLen() (int64, error)
func (*DaoRedisEx) LPop ¶
func (p *DaoRedisEx) LPop(value interface{}) error
func (*DaoRedisEx) LPopEx ¶
func (p *DaoRedisEx) LPopEx(key string, value interface{}) error
func (*DaoRedisEx) LPush ¶
func (p *DaoRedisEx) LPush(value interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) LPushEx ¶
func (p *DaoRedisEx) LPushEx(key string, value interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) LREMEx ¶
func (p *DaoRedisEx) LREMEx(key string, count int, data interface{}) (error, int)
func (*DaoRedisEx) LRange ¶
func (p *DaoRedisEx) LRange(start int, end int, value interface{}) (err error)
func (*DaoRedisEx) LRangeEx ¶
func (p *DaoRedisEx) LRangeEx(key string, start int, end int, value interface{}) (err error)
func (*DaoRedisEx) LTRIMEx ¶
func (p *DaoRedisEx) LTRIMEx(key string, start int, end int) (err error)
func (*DaoRedisEx) MDel ¶
func (p *DaoRedisEx) MDel(key []string, ops ...OpOptionEx) error
func (*DaoRedisEx) MGet ¶
func (p *DaoRedisEx) MGet(keys []string, data interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) MGetGo ¶
func (p *DaoRedisEx) MGetGo(keys []string, data interface{}) error
封装mget通过go并发get
func (*DaoRedisEx) MSet ¶
func (p *DaoRedisEx) MSet(datas map[string]interface{}, ops ...OpOptionEx) error
MSet mset
func (*DaoRedisEx) Persist ¶
func (p *DaoRedisEx) Persist(key string, ops ...OpOptionEx) error
Persist 永久生效
func (*DaoRedisEx) PipelineHGet ¶
func (p *DaoRedisEx) PipelineHGet(key []string, fields []interface{}, data []interface{}) error
func (*DaoRedisEx) RPop ¶
func (p *DaoRedisEx) RPop(value interface{}) error
func (*DaoRedisEx) RPopEx ¶
func (p *DaoRedisEx) RPopEx(key string, value interface{}) error
func (*DaoRedisEx) RPush ¶
func (p *DaoRedisEx) RPush(value interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) RPushEx ¶
func (p *DaoRedisEx) RPushEx(key string, value interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) SAdd ¶
func (p *DaoRedisEx) SAdd(key string, argPs []interface{}, ops ...OpOptionEx) error
Set集合Start
func (*DaoRedisEx) SCard ¶
func (p *DaoRedisEx) SCard(key string) int64
func (*DaoRedisEx) SIsMember ¶
func (p *DaoRedisEx) SIsMember(key string, arg interface{}) (b bool, err error)
func (*DaoRedisEx) SMembers ¶
func (p *DaoRedisEx) SMembers(key string) (data []interface{}, err error)
func (*DaoRedisEx) SPop ¶
func (p *DaoRedisEx) SPop(key string, value interface{}) error
func (*DaoRedisEx) SRem ¶
func (p *DaoRedisEx) SRem(key string, argPs []interface{}) error
func (*DaoRedisEx) Set ¶
func (p *DaoRedisEx) Set(key string, value interface{}, ops ...OpOptionEx) (err error)
基础结束
func (*DaoRedisEx) SetEx ¶
func (p *DaoRedisEx) SetEx(key string, value interface{}, expire int, ops ...OpOptionEx) error
SetEx setex
func (*DaoRedisEx) SetNX ¶
func (p *DaoRedisEx) SetNX(key string, value interface{}, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) SetNXNoExpire ¶
func (p *DaoRedisEx) SetNXNoExpire(key string, value interface{}, ops ...OpOptionEx) (int64, error)
func (*DaoRedisEx) ZAdd ¶
func (p *DaoRedisEx) ZAdd(key string, score interface{}, value interface{}, ops ...OpOptionEx) error
sorted set start
func (*DaoRedisEx) ZAddM ¶
func (p *DaoRedisEx) ZAddM(key string, value map[float64]interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) ZCount ¶
func (p *DaoRedisEx) ZCount(key string, min, max int) (data int, err error)
func (*DaoRedisEx) ZGetByScore ¶
func (*DaoRedisEx) ZGetByScoreLimit ¶
func (p *DaoRedisEx) ZGetByScoreLimit(key string, sort bool, offset uint32, limit uint32, value interface{}) error
ZRANGEBYSCORE <KEY> -inf +inf limit <offset> <limit>
func (*DaoRedisEx) ZGetByScoreWithSize ¶
func (p *DaoRedisEx) ZGetByScoreWithSize(key string, sort bool, start int, end int, offset uint32, limit uint32, value interface{}) error
ZRANGEBYSCORE <KEY> min max limit offset limit
func (*DaoRedisEx) ZGetWithScores ¶
func (*DaoRedisEx) ZGetWithScoresLimit ¶
func (p *DaoRedisEx) ZGetWithScoresLimit(key string, sort bool, offset uint32, limit uint32) (err error, data []ModelRedisZSetListWithScore)
ZRANGEBYSCORE <KEY> -inf +inf WITHSCORES limit <offset> <limit>
func (*DaoRedisEx) ZGetWithScoresSlice ¶
func (p *DaoRedisEx) ZGetWithScoresSlice(key string, sort bool, start int, end int) (err error, data []ModelRedisZSetListWithScore)
func (*DaoRedisEx) ZIncrBy ¶
func (p *DaoRedisEx) ZIncrBy(key string, increment int, member interface{}, ops ...OpOptionEx) error
func (*DaoRedisEx) ZRem ¶
func (p *DaoRedisEx) ZRem(key string, data ...interface{}) error
type EventBus ¶
func NewEventBus ¶
type IModelMongo ¶
type IModelMysql ¶
type ModelMongo ¶
自增id使用
func (*ModelMongo) ExistId ¶
func (m *ModelMongo) ExistId() (b bool)
func (*ModelMongo) GetCreatedTime ¶
func (m *ModelMongo) GetCreatedTime() time.Time
func (*ModelMongo) GetId ¶
func (m *ModelMongo) GetId() int64
func (*ModelMongo) InitTime ¶
func (m *ModelMongo) InitTime(t time.Time)
func (*ModelMongo) SetId ¶
func (m *ModelMongo) SetId(id int64)
func (*ModelMongo) SetObjectId ¶
func (m *ModelMongo) SetObjectId()
func (*ModelMongo) SetUpdatedTime ¶
func (m *ModelMongo) SetUpdatedTime(t time.Time)
type ModelMongoBase ¶
type ModelMongoBase struct {
Id primitive.ObjectID `bson:"_id,omitempty" json:"id"`
BaseMongo `bson:",inline"`
}
db生成id使用
func (*ModelMongoBase) ExistId ¶
func (m *ModelMongoBase) ExistId() (b bool)
func (*ModelMongoBase) GetCreatedTime ¶
func (m *ModelMongoBase) GetCreatedTime() time.Time
func (*ModelMongoBase) GetId ¶
func (m *ModelMongoBase) GetId() (id int64)
func (*ModelMongoBase) InitTime ¶
func (m *ModelMongoBase) InitTime(t time.Time)
func (*ModelMongoBase) SetId ¶
func (m *ModelMongoBase) SetId(id int64)
func (*ModelMongoBase) SetObjectId ¶
func (m *ModelMongoBase) SetObjectId()
func (*ModelMongoBase) SetUpdatedTime ¶
func (m *ModelMongoBase) SetUpdatedTime(t time.Time)
type ModelMongoBaseEx ¶
type ModelMongoBaseEx struct {
Id primitive.ObjectID `bson:"_id,omitempty" json:"id"`
BaseMongoEx `bson:",inline"`
}
db生成id使用
func (*ModelMongoBaseEx) ExistId ¶
func (m *ModelMongoBaseEx) ExistId() (b bool)
func (*ModelMongoBaseEx) GetCreatedTime ¶
func (m *ModelMongoBaseEx) GetCreatedTime() time.Time
func (*ModelMongoBaseEx) GetId ¶
func (m *ModelMongoBaseEx) GetId() (id int64)
func (*ModelMongoBaseEx) InitTime ¶
func (m *ModelMongoBaseEx) InitTime(t time.Time)
func (*ModelMongoBaseEx) SetId ¶
func (m *ModelMongoBaseEx) SetId(id int64)
func (*ModelMongoBaseEx) SetObjectId ¶
func (m *ModelMongoBaseEx) SetObjectId()
func (*ModelMongoBaseEx) SetUpdatedTime ¶
func (m *ModelMongoBaseEx) SetUpdatedTime(t time.Time)
type ModelMongoEx ¶
type ModelMongoEx struct {
Id int64 `bson:"_id,omitempty" json:"id"`
BaseMongoEx `bson:",inline"`
}
自增id使用
func (*ModelMongoEx) ExistId ¶
func (m *ModelMongoEx) ExistId() (b bool)
func (*ModelMongoEx) GetCreatedTime ¶
func (m *ModelMongoEx) GetCreatedTime() time.Time
func (*ModelMongoEx) GetId ¶
func (m *ModelMongoEx) GetId() int64
func (*ModelMongoEx) InitTime ¶
func (m *ModelMongoEx) InitTime(t time.Time)
func (*ModelMongoEx) SetId ¶
func (m *ModelMongoEx) SetId(id int64)
func (*ModelMongoEx) SetObjectId ¶
func (m *ModelMongoEx) SetObjectId()
func (*ModelMongoEx) SetUpdatedTime ¶
func (m *ModelMongoEx) SetUpdatedTime(t time.Time)
type ModelMysql ¶
type ModelMysql struct {
Id int `sql:"AUTO_INCREMENT" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (*ModelMysql) GetId ¶
func (m *ModelMysql) GetId() int
func (*ModelMysql) InitTime ¶
func (m *ModelMysql) InitTime(t time.Time)
func (*ModelMysql) SetId ¶
func (m *ModelMysql) SetId(id int)
func (*ModelMysql) SetUpdatedTime ¶
func (m *ModelMysql) SetUpdatedTime(t time.Time)
type MysqlConnection ¶
func (MysqlConnection) Close ¶
func (p MysqlConnection) Close()
func (MysqlConnection) Put ¶
func (p MysqlConnection) Put()
func (MysqlConnection) PutCluster ¶
func (p MysqlConnection) PutCluster(d *DaoMysqlCluster)
type Nacos ¶
type Nacos struct {
Client config_client.IConfigClient
}
type OnShutdownF ¶
type OnShutdownF struct {
// contains filtered or unexported fields
}
type OpOptionEx ¶
type OpOptionEx func(*DaoRedisEx)
func WithClusterKey ¶
func WithClusterKey() OpOptionEx
func WithExpire ¶
func WithExpire(expire int) OpOptionEx
WithExpire 设置超时时间 - 为了兼容之前的命令写法 无expire时 加expire
type RedisDynamicAddress ¶
type RedisDynamicAddress struct {
Address []string // 地址列表
AddressLen int32 // 地址总数
AddressIndex atomic.Int32 // 地址获取索引 从0到AddressLen-1
ErrorConnM sync.Map // 地址连接错误 k 是索引 v 是空
ErrorConnNum atomic.Int32 // 地址连接错误数
FlagCount atomic.Int32 // 更新标记统计
Flag chan struct{} // 是否主动重置
L sync.RWMutex
}
func (*RedisDynamicAddress) GetAddress ¶
func (p *RedisDynamicAddress) GetAddress() (addr string, index int32)
type UploadFile ¶
Source Files
¶
- config.go
- config_app.go
- config_cache.go
- config_code.go
- config_db.go
- config_es.go
- config_mongo_cluster.go
- config_mysql_cluster.go
- config_pool.go
- config_project.go
- config_tracer.go
- dao_es.go
- dao_es_factory.go
- dao_esv5.go
- dao_esv5_factory.go
- dao_esv6.go
- dao_esv6_factory.go
- dao_esv7.go
- dao_grpc.go
- dao_mongo.go
- dao_mongo_cluster.go
- dao_mysql.go
- dao_mysql_cluster.go
- dao_redis.go
- dao_redis_ex.go
- event_bus.go
- gin.go
- global.go
- grpc.go
- imodel_es.go
- imodel_mongo.go
- imodel_mysql.go
- init.go
- log.go
- logic_limiter.go
- middleware_limiter.go
- middleware_recover.go
- model_mongo.go
- model_mysql.go
- model_redis.go
- pconst.go
- pool_mysql_cluster.go
- tracer_init.go
- tracer_middleware.go
- tracer_skywalking.go
- util_crypto.go
- util_curl.go
- util_float64.go
- util_gofunc.go
- util_http.go
- util_log.go
- util_mq.go
- util_request.go
- util_response.go
- util_sign.go
- util_string.go
- util_time.go