syncer

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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
	//
	WriteMetrics(id string, metric *EarsMetric)
	//
	ReadMetrics(id string) *EarsMetric
}

func NewInMemoryDeltaSyncer

func NewInMemoryDeltaSyncer(logger *zerolog.Logger, config config.Config) DeltaSyncer

type DeltaSyncerGroup

type DeltaSyncerGroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type EarsMetric added in v1.1.2

type EarsMetric struct {
	SuccessCount    int
	ErrorCount      int
	FilterCount     int
	SuccessVelocity int
	ErrorVelocity   int
	FilterVelocity  int
	LastEventTs     int64
}

type InmemoryDeltaSyncer

type InmemoryDeltaSyncer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*InmemoryDeltaSyncer) GetInstanceCount

func (s *InmemoryDeltaSyncer) GetInstanceCount(ctx context.Context) int

func (*InmemoryDeltaSyncer) PublishSyncRequest

func (s *InmemoryDeltaSyncer) PublishSyncRequest(ctx context.Context, tid tenant.Id, itemType string, itemId string, add bool)

func (*InmemoryDeltaSyncer) ReadMetrics added in v1.1.2

func (s *InmemoryDeltaSyncer) ReadMetrics(id string) *EarsMetric

id should be a unique plugin id

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)

func (*InmemoryDeltaSyncer) WriteMetrics added in v1.1.2

func (s *InmemoryDeltaSyncer) WriteMetrics(id string, metric *EarsMetric)

type LocalSyncer

type LocalSyncer interface {
	// SyncRoute
	SyncItem(ctx context.Context, tid tenant.Id, itemId string, add bool) error
}

type SyncCommand

type SyncCommand struct {
	Cmd        string
	ItemType   string
	ItemId     string
	InstanceId string
	Sid        string
	Tenant     tenant.Id
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL