Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorWaitTimeOut = errors.New("concurrencyx error: Wait timeout") ErrorReachConcurrencyThreshold = errors.New("concurrencyx error: Concurrency threshold reached") ErrorInvalidServiceUniqueName = errors.New("concurrencyx error: Service unique name is invalid") ErrorInvalidRedisObject = errors.New("concurrencyx error: The redis is nil") ErrorRedisCanNotConnect = errors.New("concurrencyx error: Can not connect redis") ErrorCreateLockCreator = errors.New("concurrencyx error: Create lock creator fail") ErrorSecondsFiledTooLarge = errors.New("concurrencyx error: The value of the seconds field of the strategy is too large") ErrorThresholdTooSmall = errors.New("concurrencyx error: The value of the threshold field of the strategy is too small") )
Functions ¶
This section is empty.
Types ¶
type ConcurrencyX ¶
type ConcurrencyX struct {
DenyStrategyManagementInterface
InterfaceConcurrencyX
// contains filtered or unexported fields
}
func CreateConcurrencyX ¶
func CreateConcurrencyX(ctx context.Context, srvUniqueName string, rDb *redis.Client, denyStrategy map[Seconds]DenyThreshold) (*ConcurrencyX, error)
type DenyStrategyManagementInterface ¶
type DenyStrategyManagementInterface interface {
AddStrategy(s Seconds, threshold DenyThreshold) error
DelStrategy(s Seconds)
OutPut() *map[Seconds]DenyThreshold
}
type DenyThreshold ¶
type DenyThreshold uint
type InterfaceConcurrencyX ¶
Click to show internal directories.
Click to hide internal directories.