Documentation
¶
Index ¶
- Constants
- Variables
- func GetRegisted() []any
- func PubGormDeleted(ctx context.Context, payload any) error
- func PubGormSaved(ctx context.Context, payload any) error
- func Reg(payload any)
- type DefaultMessgingService
- func (msg *DefaultMessgingService) ProcessPendings(ctx context.Context, topic, group string, processor Processor)
- func (msg *DefaultMessgingService) Pub(ctx context.Context, topic string, payload any) error
- func (msg *DefaultMessgingService) Sub(ctx context.Context, topic, group string, processor Processor) error
- type GormAction
- type GormObjSyncService
- type GormPayload
- type IDbase
- type MessagingService
- type Processor
- type Sharding
Constants ¶
View Source
const ( GormActionSave = "save" GormActionDelete = "delete" )
View Source
const ( DefaultMsgLimit = 10000 DefaultAttKey = "payload" DefaultSchedule = "@every 30m" DefaultDeadLetterDurtion = 8 * time.Hour //if messaging pending for more than this duration, will be put to dead letter )
Variables ¶
View Source
var DefaultGormToipc = "scm.gorm.saved"
View Source
var GormMessagingEnabled = true
Functions ¶
func GetRegisted ¶
func GetRegisted() []any
GetRegisted function is used to obtain a list of registered entities.
Types ¶
type DefaultMessgingService ¶
type DefaultMessgingService struct {
Logger *zap.Logger
Client *redis.Client
PendingSchedule string
Settings map[string]int64 // settings for streaming limit settings. default 10000
}
func (*DefaultMessgingService) ProcessPendings ¶
func (msg *DefaultMessgingService) ProcessPendings(ctx context.Context, topic, group string, processor Processor)
type GormAction ¶
type GormAction string
type GormObjSyncService ¶
type GormObjSyncService struct {
MessageService MessagingService
DB *gorm.DB
Logger *zap.Logger
Sharding Sharding
}
func NewGormObjSyncService ¶
func NewGormObjSyncService(ms MessagingService, logger *zap.Logger, db *gorm.DB) *GormObjSyncService
func (*GormObjSyncService) ReceiveGormObjectSaved ¶
type GormPayload ¶
type GormPayload struct {
Key string
Action GormAction
Payload []byte
}
type MessagingService ¶
type MessagingService interface {
Pub(ctx context.Context, topic string, payload any) error
Sub(ctx context.Context, topic, consumer string, processor Processor) error
}
MessagingService, default impl Redis streaming.
Click to show internal directories.
Click to hide internal directories.