transactionaloutbox

package
v0.0.0-...-ff2bd9c Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package transactionaloutbox is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTransactionalOutboxServiceInterface

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

MockTransactionalOutboxServiceInterface is a mock of TransactionalOutboxServiceInterface interface.

func NewMockTransactionalOutboxServiceInterface

func NewMockTransactionalOutboxServiceInterface(ctrl *gomock.Controller) *MockTransactionalOutboxServiceInterface

NewMockTransactionalOutboxServiceInterface creates a new mock instance.

func (*MockTransactionalOutboxServiceInterface) Cancel

func (m *MockTransactionalOutboxServiceInterface) Cancel(ctx context.Context, eventName, idempotentID string) error

Cancel mocks base method.

func (*MockTransactionalOutboxServiceInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTransactionalOutboxServiceInterface) Push

func (m *MockTransactionalOutboxServiceInterface) Push(ctx context.Context, eventName, idempotentID string, data []byte) error

Push mocks base method.

func (*MockTransactionalOutboxServiceInterface) Run

Run mocks base method.

type MockTransactionalOutboxServiceInterfaceMockRecorder

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

MockTransactionalOutboxServiceInterfaceMockRecorder is the mock recorder for MockTransactionalOutboxServiceInterface.

func (*MockTransactionalOutboxServiceInterfaceMockRecorder) Cancel

func (mr *MockTransactionalOutboxServiceInterfaceMockRecorder) Cancel(ctx, eventName, idempotentID interface{}) *gomock.Call

Cancel indicates an expected call of Cancel.

func (*MockTransactionalOutboxServiceInterfaceMockRecorder) Push

func (mr *MockTransactionalOutboxServiceInterfaceMockRecorder) Push(ctx, eventName, idempotentID, data interface{}) *gomock.Call

Push indicates an expected call of Push.

func (*MockTransactionalOutboxServiceInterfaceMockRecorder) Run

Run indicates an expected call of Run.

type OutboxEventStatus

type OutboxEventStatus string
const (
	FEATURE_FLAG_KEY_COLUMN_NAME = "key"

	PUBLISHED OutboxEventStatus = "PUBLISHED"
	SCHEDULED OutboxEventStatus = "SCHEDULED"
	CANCELED  OutboxEventStatus = "CANCELED"
)

type TransactionalOutboxEvent

type TransactionalOutboxEvent struct {
	ID           uuid.UUID  `json:"id" gorm:"primaryKey,not null"`
	EventName    string     `json:"event_name" gorm:"uniqueIndex:event_name_and_idempotent_id__transactional_outbox_event__idx,not null"`
	IdempotentID string     `json:"idempotent_id" gorm:"uniqueIndex:event_name_and_idempotent_id__transactional_outbox_event__idx,not null"`
	Data         []byte     `json:"data" gorm:"not null"`
	ScheduledAt  time.Time  `json:"scheduled_at" gorm:"index:scheduled_at__transactional_outbox_event__idx,not null"`
	PublishedAt  *time.Time `json:"published_at" gorm:"null"`
	CreatedAt    time.Time  `json:"created_at" gorm:"not null"`
	CreatedBy    uuid.UUID  `json:"created_by" gorm:"not null"`
	UpdatedAt    time.Time  `json:"updated_at" gorm:"not null"`
	UpdatedBy    uuid.UUID  `json:"updated_by" gorm:"not null"`
	DeletedAt    *time.Time `json:"deleted_at" gorm:"null"`
	DeletedBy    *uuid.UUID `json:"deleted_by" gorm:"null"`
}

mutable: will be hardly delete when the event succesfully published or canceled

func NewTransactionalOutboxEvent

func NewTransactionalOutboxEvent(eventName string, idempotentID string, data []byte, scheduledAt time.Time, publishedAt *time.Time) *TransactionalOutboxEvent

type TransactionalOutboxEventLog

type TransactionalOutboxEventLog struct {
	ID           uuid.UUID         `json:"id" gorm:"primaryKey,not null"`
	EventName    string            `json:"event_name" gorm:"uniqueIndex:event_name_and_idempotent_id_and_status__transactional_outbox_event_log__idx,not null"`
	IdempotentID string            `json:"idempotent_id" gorm:"uniqueIndex:event_name_and_idempotent_id_and_status__transactional_outbox_event_log__idx,not null"`
	ProcessedAt  time.Time         `json:"processed_at" gorm:"not null"`
	Data         []byte            `json:"data" gorm:"not null"`
	Status       OutboxEventStatus `json:"status" gorm:"uniqueIndex:event_name_and_idempotent_id_and_status__transactional_outbox_event_log__idx,not null"`
	CreatedAt    time.Time         `json:"created_at" gorm:"not null"`
	CreatedBy    uuid.UUID         `json:"created_by" gorm:"not null"`
}

immutable

func NewTransactionalOutboxEventLog

func NewTransactionalOutboxEventLog(eventName string, idempotentID string, data []byte, processedAt time.Time, status OutboxEventStatus) *TransactionalOutboxEventLog

type TransactionalOutboxService

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

func (*TransactionalOutboxService) Cancel

func (s *TransactionalOutboxService) Cancel(ctx context.Context, eventName string, idempotentID string) error

func (*TransactionalOutboxService) Push

func (s *TransactionalOutboxService) Push(ctx context.Context, eventName string, idempotentID string, data []byte) error

func (*TransactionalOutboxService) Run

type TransactionalOutboxServiceInterface

type TransactionalOutboxServiceInterface interface {
	Push(ctx context.Context, eventName string, idempotentID string, data []byte) error
	Cancel(ctx context.Context, eventName string, idempotentID string) error
	Run(ctx context.Context)
}

Jump to

Keyboard shortcuts

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