Documentation
¶
Index ¶
- Constants
- type DeltaSyncer
- type DeltaSyncerGroup
- type InmemoryDeltaSyncer
- func (s *InmemoryDeltaSyncer) GetInstanceCount(ctx context.Context) int
- func (s *InmemoryDeltaSyncer) PublishSyncRequest(ctx context.Context, tid tenant.Id, itemType string, itemId string, add bool)
- func (s *InmemoryDeltaSyncer) RegisterLocalSyncer(itemType string, localSyncer LocalSyncer)
- func (s *InmemoryDeltaSyncer) StartListeningForSyncRequests()
- func (s *InmemoryDeltaSyncer) StopListeningForSyncRequests()
- func (s *InmemoryDeltaSyncer) UnregisterLocalSyncer(itemType string, localSyncer LocalSyncer)
- type LocalSyncer
- type RedisDeltaSyncer
- func (s *RedisDeltaSyncer) GetInstanceCount(ctx context.Context) int
- func (s *RedisDeltaSyncer) PublishSyncRequest(ctx context.Context, tid tenant.Id, itemType string, itemId string, add bool)
- func (s *RedisDeltaSyncer) RegisterLocalSyncer(itemType string, localSyncer LocalSyncer)
- func (s *RedisDeltaSyncer) StartListeningForSyncRequests()
- func (s *RedisDeltaSyncer) StopListeningForSyncRequests()
- func (s *RedisDeltaSyncer) UnregisterLocalSyncer(itemType string, localSyncer LocalSyncer)
- type SyncCommand
Constants ¶
View Source
const ( // used by one instance of ears to ask others to sync routing table EARS_REDIS_SYNC_CHANNEL = "ears_sync" // used by one instance of ears to tell all others that it just finished syncing its routing table EARS_REDIS_ACK_CHANNEL = "ears_ack" EARS_REDIS_RETRY_INTERVAL_SECONDS = 10 * time.Second )
View Source
const ( EARS_ADD_ITEM_CMD = "add" EARS_REMOVE_ITEM_CMD = "rem" EARS_STOP_LISTENING_CMD = "stop" )
View Source
const ( ITEM_TYPE_ROUTE = "route" ITEM_TYPE_TENANT = "tenant" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeltaSyncer ¶
type DeltaSyncer interface {
// StartListeningForSyncRequests
StartListeningForSyncRequests() // do we need this still?
// StopListeningForSyncRequests
StopListeningForSyncRequests() // do we need this still?
// RegisterLocalTableSyncer
RegisterLocalSyncer(itemType string, localTableSyncer LocalSyncer)
// UnregisterLocalTableSyncer
UnregisterLocalSyncer(itemType string, localTableSyncer LocalSyncer)
// PublishSyncRequest
PublishSyncRequest(ctx context.Context, tenantId tenant.Id, itemType string, itemId string, add bool)
// GetInstanceCount
GetInstanceCount(ctx context.Context) int
}
func NewInMemoryDeltaSyncer ¶
func NewInMemoryDeltaSyncer(logger *zerolog.Logger, config config.Config) DeltaSyncer
func NewRedisDeltaSyncer ¶
func NewRedisDeltaSyncer(logger *zerolog.Logger, config config.Config) DeltaSyncer
type DeltaSyncerGroup ¶
type InmemoryDeltaSyncer ¶
func (*InmemoryDeltaSyncer) GetInstanceCount ¶
func (s *InmemoryDeltaSyncer) GetInstanceCount(ctx context.Context) int
func (*InmemoryDeltaSyncer) PublishSyncRequest ¶
func (*InmemoryDeltaSyncer) RegisterLocalSyncer ¶
func (s *InmemoryDeltaSyncer) RegisterLocalSyncer(itemType string, localSyncer LocalSyncer)
func (*InmemoryDeltaSyncer) StartListeningForSyncRequests ¶
func (s *InmemoryDeltaSyncer) StartListeningForSyncRequests()
ListenForSyncRequests listens for sync request
func (*InmemoryDeltaSyncer) StopListeningForSyncRequests ¶
func (s *InmemoryDeltaSyncer) StopListeningForSyncRequests()
StopListeningForSyncRequests stops listening for sync requests
func (*InmemoryDeltaSyncer) UnregisterLocalSyncer ¶
func (s *InmemoryDeltaSyncer) UnregisterLocalSyncer(itemType string, localSyncer LocalSyncer)
type LocalSyncer ¶
type RedisDeltaSyncer ¶
func (*RedisDeltaSyncer) GetInstanceCount ¶
func (s *RedisDeltaSyncer) GetInstanceCount(ctx context.Context) int
func (*RedisDeltaSyncer) PublishSyncRequest ¶
func (s *RedisDeltaSyncer) PublishSyncRequest(ctx context.Context, tid tenant.Id, itemType string, itemId string, add bool)
PublishSyncRequest asks others to sync their routing tables
func (*RedisDeltaSyncer) RegisterLocalSyncer ¶
func (s *RedisDeltaSyncer) RegisterLocalSyncer(itemType string, localSyncer LocalSyncer)
func (*RedisDeltaSyncer) StartListeningForSyncRequests ¶
func (s *RedisDeltaSyncer) StartListeningForSyncRequests()
ListenForSyncRequests listens for sync request
func (*RedisDeltaSyncer) StopListeningForSyncRequests ¶
func (s *RedisDeltaSyncer) StopListeningForSyncRequests()
StopListeningForSyncRequests stops listening for sync requests
func (*RedisDeltaSyncer) UnregisterLocalSyncer ¶
func (s *RedisDeltaSyncer) UnregisterLocalSyncer(itemType string, localSyncer LocalSyncer)
Click to show internal directories.
Click to hide internal directories.