streams

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 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 {
	GetAllEvents(
		ctx context.Context,
		tenant string,
		topic string,
		includedEventTypes []string,
		perPage int,
		queueSize int,
		handler dto.HandlerFunc,
	) error
	GetAllEventsAfterEvent(
		ctx context.Context,
		tenant string,
		topic string,
		includedEventTypes []string,
		eventId string,
		perPage int,
		queueSize int,
		handler dto.HandlerFunc,
	) error
	GetStream(
		ctx context.Context,
		tenant string,
		topic string,
		stream string,
		deploymentId int64,
		perPage int,
		queueSize int,
		handler dto.HandlerFunc,
	) error
	GetStreamAfterEvent(
		ctx context.Context,
		tenant string,
		topic string,
		stream string,
		eventId string,
		deploymentId int64,
		perPage int,
		queueSize int,
		handler dto.HandlerFunc,
	) error
	IsStreamEmpty(ctx context.Context, tenant string, topic string, stream string) (bool, error)
	GetEvent(ctx context.Context, tenantId string, topic string, eventId string) (*dto.SubscriptionEvent, error)
	GetLastEvent(ctx context.Context, tenantId string, topic string) (*dto.SubscriptionEvent, error)
	GetLastEventByTypes(
		ctx context.Context,
		tenantId string,
		topic string,
		types []string,
	) (*dto.SubscriptionEvent, error)
	NewSubscription(topics []string, ignoreUnhandledEvents bool, deploymentId int64) *client.Subscription
	Publish(ctx context.Context, topic string, events []*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
	CreateStreamSnapshot(
		ctx context.Context,
		tenantId string,
		topic string,
		stream string,
		lastSnapshottedEventId string,
		snapshotEvent *dto.PublishEvent,
	) error
	RenameEventType(ctx context.Context, topic string, oldEventType string, newEventType string) error
	Close()
}

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) GetAllEvents

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

func (*MockClient) GetAllEventsAfterEvent

func (c *MockClient) GetAllEventsAfterEvent(
	ctx context.Context,
	tenant string,
	topic string,
	includedEventTypes []string,
	eventId string,
	perPage int,
	queueSize int,
	handler dto.HandlerFunc,
) 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) GetStream

func (c *MockClient) GetStream(
	ctx context.Context,
	tenant string,
	topic string,
	stream string,
	deploymentId int64,
	perPage int,
	queueSize int,
	handler dto.HandlerFunc,
) error

func (*MockClient) GetStreamAfterEvent

func (c *MockClient) GetStreamAfterEvent(
	ctx context.Context,
	tenant string,
	topic string,
	stream string,
	eventId string,
	deploymentId int64,
	perPage int,
	queueSize int,
	handler dto.HandlerFunc,
) 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) 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

Directories

Path Synopsis
domain
dto
internal

Jump to

Keyboard shortcuts

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