producer

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExpiration = 5 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type SinkActivityEvent added in v0.29.0

type SinkActivityEvent struct {
	OwnerID   string
	SinkID    string
	State     string
	Size      string
	Timestamp time.Time
}

func (*SinkActivityEvent) Encode added in v0.29.0

func (s *SinkActivityEvent) Encode() map[string]interface{}

type SinkActivityProducer added in v0.29.0

type SinkActivityProducer interface {
	// PublishSinkActivity to be used to publish the sink activity to the sinker, mainly used by Otel Bridge Service
	PublishSinkActivity(ctx context.Context, event SinkActivityEvent) error
}

func NewSinkActivityProducer added in v0.29.0

func NewSinkActivityProducer(l *zap.Logger, redisStreamClient *redis.Client, sinkTTL SinkerKeyService) SinkActivityProducer

type SinkIdleEvent added in v0.29.0

type SinkIdleEvent struct {
	OwnerID   string
	SinkID    string
	State     string
	Size      string
	Timestamp time.Time
}

func (*SinkIdleEvent) Encode added in v0.29.0

func (s *SinkIdleEvent) Encode() map[string]interface{}

type SinkIdleProducer added in v0.29.0

type SinkIdleProducer interface {
	// PublishSinkIdle to be used to publish the sink activity to the sinker, mainly used by Otel Bridge Service
	PublishSinkIdle(ctx context.Context, event SinkIdleEvent) error
}

func NewSinkIdleProducer added in v0.29.0

func NewSinkIdleProducer(l *zap.Logger, redisStreamClient *redis.Client) SinkIdleProducer

type SinkerKey added in v0.29.0

type SinkerKey struct {
	OwnerID      string
	SinkID       string
	Size         string
	LastActivity time.Time
}

func (*SinkerKey) Encode added in v0.29.0

func (s *SinkerKey) Encode() map[string]interface{}

type SinkerKeyService added in v0.29.0

type SinkerKeyService interface {
	// AddNewSinkerKey Add New Sinker Key with default Expiration of 5 minutes
	AddNewSinkerKey(ctx context.Context, key SinkerKey) error
	// RenewSinkerKey Increment Expiration of Sinker Key
	RenewSinkerKey(ctx context.Context, key SinkerKey) error
	// RenewSinkerKeyInternal Increment Expiration of Sinker Key
	RenewSinkerKeyInternal(ctx context.Context, sink SinkerKey, expiration time.Duration) error
}

func NewSinkerKeyService added in v0.29.0

func NewSinkerKeyService(l *zap.Logger, cacheRepository *redis.Client) SinkerKeyService

Jump to

Keyboard shortcuts

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