streams

package
v0.49.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 7 Imported by: 0

README

streams

Client implementation in go for the Freym service streams.

Docs

Please have a look at our documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Close()
	Publish(ctx context.Context, topic string, events []*dto.PublishEvent) error
	NewSubscription(topics []string, ignoreUnhandledEvents bool, deploymentId int64) *client.Subscription
	GetEvent(ctx context.Context, tenantId string, topic string, eventId string) (*dto.SubscriptionEvent, error)
	GetLastEvent(ctx context.Context, tenantId string, topic string) (*dto.SubscriptionEvent, error)
	GetLastHandledEvent(ctx context.Context, tenantId string, topic string) (*dto.SubscriptionEvent, error)
	GetLastEventByTypes(
		ctx context.Context,
		tenantId string,
		topic string,
		types []string,
	) (*dto.SubscriptionEvent, error)
	IterateAllEvents(
		ctx context.Context,
		tenant string,
		topic string,
		includedEventTypes []string,
		perPage int,
		queueSize int,
		handler dto.IterateHandlerFunc,
	) error
	IterateAllEventsAfterEvent(
		ctx context.Context,
		tenant string,
		topic string,
		includedEventTypes []string,
		eventId string,
		perPage int,
		queueSize int,
		handler dto.IterateHandlerFunc,
	) error
	IsStreamEmpty(ctx context.Context, tenant string, topic string, stream string) (bool, error)
	IterateStream(
		ctx context.Context,
		tenant string,
		topic string,
		stream string,
		deploymentId int64,
		perPage int,
		queueSize int,
		doNotUseSnapshots bool,
		handler dto.IterateHandlerFunc,
	) error
	IterateStreamAfterEvent(
		ctx context.Context,
		tenant string,
		topic string,
		stream string,
		eventId string,
		deploymentId int64,
		perPage int,
		queueSize int,
		doNotUseSnapshots bool,
		handler dto.IterateHandlerFunc,
	) error
	CreateStreamSnapshot(
		ctx context.Context,
		tenantId string,
		topic string,
		stream string,
		lastSnapshottedEventId string,
		snapshotEvent *dto.PublishEvent,
	) error
	InvalidateGdprData(ctx context.Context, tenantId string, topic string, gdprId string) error
	IntroduceGdprOnEventField(
		ctx context.Context,
		tenantId string,
		topic string,
		eventId string,
		fieldName string,
		defaultValue string,
	) error
	RenameEventType(ctx context.Context, topic string, oldEventType string, newEventType string) error
	WaitForTransactionalConsistency(
		ctx context.Context,
		tenantId string,
		topic string,
		correlationId string,
		consumerGroups []string,
	) error
	ListErroneousEvents(
		ctx context.Context,
		tenantId string,
		topic string,
		eventTypes []string,
		limit int64,
	) ([]*dto.ErroneousEvent, error)
	ResendErroneousEvent(
		ctx context.Context,
		tenantId string,
		topic string,
		consumerGroup string,
		eventId string,
	) error
}

func NewClient

func NewClient(
	logger golog.Logger,
	conf *config.Config,
) (Client, error)

type MockClient

type MockClient struct {
	mock.Mock
}

func (*MockClient) Close

func (c *MockClient) Close()

func (*MockClient) CreateStreamSnapshot

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

func (*MockClient) GetEvent

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

func (*MockClient) GetLastEvent

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

func (*MockClient) GetLastEventByTypes

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

func (*MockClient) GetLastHandledEvent added in v0.41.0

func (c *MockClient) GetLastHandledEvent(
	ctx context.Context,
	tenantId string,
	topic string,
) (*dto.SubscriptionEvent, error)

func (*MockClient) IntroduceGdprOnEventField

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

func (*MockClient) InvalidateGdprData

func (c *MockClient) InvalidateGdprData(ctx context.Context, tenantId string, topic string, gdprId string) error

func (*MockClient) IsStreamEmpty

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

func (*MockClient) IterateAllEvents added in v0.38.0

func (c *MockClient) IterateAllEvents(
	ctx context.Context,
	tenant string,
	topic string,
	includedEventTypes []string,
	perPage int,
	queueSize int,
	handler dto.IterateHandlerFunc,
) error

func (*MockClient) IterateAllEventsAfterEvent added in v0.38.0

func (c *MockClient) IterateAllEventsAfterEvent(
	ctx context.Context,
	tenant string,
	topic string,
	includedEventTypes []string,
	eventId string,
	perPage int,
	queueSize int,
	handler dto.IterateHandlerFunc,
) error

func (*MockClient) IterateStream added in v0.38.0

func (c *MockClient) IterateStream(
	ctx context.Context,
	tenant string,
	topic string,
	stream string,
	deploymentId int64,
	perPage int,
	queueSize int,
	doNotUseSnapshots bool,
	handler dto.IterateHandlerFunc,
) error

func (*MockClient) IterateStreamAfterEvent added in v0.38.0

func (c *MockClient) IterateStreamAfterEvent(
	ctx context.Context,
	tenant string,
	topic string,
	stream string,
	eventId string,
	deploymentId int64,
	perPage int,
	queueSize int,
	doNotUseSnapshots bool,
	handler dto.IterateHandlerFunc,
) error

func (*MockClient) ListErroneousEvents added in v0.45.0

func (c *MockClient) ListErroneousEvents(
	ctx context.Context,
	tenantId string,
	topic string,
	eventTypes []string,
	limit int64,
) ([]*dto.ErroneousEvent, error)

func (*MockClient) NewSubscription

func (c *MockClient) NewSubscription(
	topics []string,
	ignoreUnhandledEvents bool,
	deploymentId int64,
) *client.Subscription

func (*MockClient) Publish

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

func (*MockClient) RenameEventType added in v0.35.0

func (c *MockClient) RenameEventType(
	ctx context.Context,
	topic string,
	oldEventType string,
	newEventType string,
) error

func (*MockClient) ResendErroneousEvent added in v0.45.0

func (c *MockClient) ResendErroneousEvent(
	ctx context.Context,
	tenantId string,
	topic string,
	consumerGroup string,
	eventId string,
) error

func (*MockClient) WaitForTransactionalConsistency added in v0.45.0

func (c *MockClient) WaitForTransactionalConsistency(
	ctx context.Context,
	tenantId string,
	topic string,
	correlationId string,
	consumerGroups []string,
) error

Directories

Path Synopsis
domain
dto
internal

Jump to

Keyboard shortcuts

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