Documentation ¶
Index ¶
Constants ¶
View Source
const ( DeleteTickerPeriod = time.Hour * 1 GlobalSecondaryIndex = "TypeExpiredIndex" DeleteCapacityRate = 5 )
Throttole const
Variables ¶
View Source
var (
ErrDuplicatedMessage = errors.New("duplicated message id")
)
throttle errors
Functions ¶
func DeleteTicker ¶
func DeleteTicker(ctx context.Context, dt *DynamodbThrottle)
DeleteTicker delete items of the previous day every hour
Types ¶
type DefaultThrottler ¶
type DefaultThrottler struct{}
DefaultThrottler do nothing
func (DefaultThrottler) Unset ¶
func (dl DefaultThrottler) Unset(k string) error
Unset DefaultThrotter
type DynamodbThrottle ¶
type DynamodbThrottle struct { TableName string Dynamodb *dynamodb.DynamoDB RetentionPeriod time.Duration }
DynamodbThrottle struct
func (DynamodbThrottle) GetExpiredItems ¶
func (dt DynamodbThrottle) GetExpiredItems() (*dynamodb.QueryOutput, error)
GetExpiredItems get items expired already.
func (*DynamodbThrottle) GetWriteCapacity ¶
func (dt *DynamodbThrottle) GetWriteCapacity() (int64, error)
GetWriteCapacity get the table of write capacity unit.
func (DynamodbThrottle) Set ¶
func (dt DynamodbThrottle) Set(jobid string) error
Set check double message
func (DynamodbThrottle) Unset ¶
func (dt DynamodbThrottle) Unset(jobid string) error
Unset delete record from dynamodb
Click to show internal directories.
Click to hide internal directories.