client

package
v0.34.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ignoreUnhandledEvents bool) *handler

Types

type LastEventCheckFunc

type LastEventCheckFunc func(ctx context.Context, lastEvent *dto.SubscriptionEvent) bool

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(
	ctx context.Context,
	config *config.Config,
	client managementpb.ServiceClient,
	logger golog.Logger,
) (*Service, error)

func (*Service) CreateStreamSnapshot

func (s *Service) CreateStreamSnapshot(ctx context.Context, tenantId string, topic string, stream string, lastSnapshottedEventId string, snapshotEvent *dto.PublishEvent) error

func (*Service) GetEvent

func (s *Service) GetEvent(ctx context.Context, tenantId string, topic string, eventId string) (*dto.SubscriptionEvent, error)

func (*Service) GetLastEvent

func (s *Service) GetLastEvent(ctx context.Context, tenantId string, topic string) (*dto.SubscriptionEvent, error)

func (*Service) GetLastEventByTypes

func (s *Service) GetLastEventByTypes(ctx context.Context, tenantId string, topic string, types []string) (*dto.SubscriptionEvent, error)

func (*Service) IntroduceGdprOnEventField

func (s *Service) IntroduceGdprOnEventField(ctx context.Context, tenantId string, topic string, eventId string, fieldName string, defaultValue string) error

func (*Service) InvalidateGdprData

func (s *Service) InvalidateGdprData(ctx context.Context, tenantId string, topic string, gdprId string) error

func (*Service) IsStreamEmpty

func (s *Service) IsStreamEmpty(ctx context.Context, tenant string, topic string, stream string) (bool, error)

func (*Service) IterateAllEvents

func (s *Service) IterateAllEvents(ctx context.Context, tenant string, topic string, types []string, perPage int, queueSize int, handler dto.HandlerFunc) error

func (*Service) IterateAllEventsAfterEvent

func (s *Service) IterateAllEventsAfterEvent(ctx context.Context, tenant string, topic string, types []string, eventId string, perPage int, queueSize int, handler dto.HandlerFunc) error

func (*Service) IterateStream

func (s *Service) IterateStream(ctx context.Context, tenant string, topic string, stream string, deploymentId int64, perPage int, queueSize int, handler dto.HandlerFunc) error

func (*Service) IterateStreamAfterEvent

func (s *Service) IterateStreamAfterEvent(ctx context.Context, tenant string, topic string, stream string, eventId string, deploymentId int64, perPage int, queueSize int, handler dto.HandlerFunc) error

func (*Service) NewSubscription

func (s *Service) NewSubscription(topics []string, ignoreUnhandledEvents bool, deploymentId int64) *Subscription

func (*Service) Publish

func (s *Service) Publish(ctx context.Context, topic string, events []*dto.PublishEvent) error

type Subscription

type Subscription struct {
	// contains filtered or unexported fields
}

func (*Subscription) Start

func (s *Subscription) Start() error

func (*Subscription) Stop

func (s *Subscription) Stop()

func (*Subscription) UseHandler

func (s *Subscription) UseHandler(eventType string, handlerFunc dto.HandlerFunc)

func (*Subscription) UseHandlerForAllEventTypes

func (s *Subscription) UseHandlerForAllEventTypes(handlerFunc dto.HandlerFunc)

Jump to

Keyboard shortcuts

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