eda

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventPublisherService

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

EventPublisherService represents implementation of event publisher service interface

func NewEventPublisherService

func NewEventPublisherService(
	awsRegion string,
	awsURL string,
	awsAccessKeyID string,
	awsSecretAccessKey string,
	awsToken string,
	pubsubTopic *pubsub.Topic,
	notifier notifier.Notifier,
	tableName string,
) *EventPublisherService

NewEventPublisherService build new event publisher service to publish to aws sqs and mirroring to dynamodb services object

func (*EventPublisherService) Publish

Publish publishing event to aws sns and mirroring to dynamodb

type EventPublisherServiceInterface

type EventPublisherServiceInterface interface {
	Publish(ctx *context.Context, params *PublishEventParams) *types.Error
}

EventPublisherServiceInterface represents the event publisher services in commerce-kit to encapsulate process to publishing event to dynamodb

type Message

type Message struct {
	Topic                    string     `json:"topic" bson:"topic"`
	Message                  []byte     `json:"message" bson:"message"`
	DistributedTransactionID string     `json:"distributedTransactionId" bson:"distributedTransactionId"`
	UID                      string     `json:"uid" bson:"uid"`
	Path                     string     `json:"path" bson:"path"`
	Method                   string     `json:"method" bson:"method"`
	Action                   string     `json:"action" bson:"action"`
	Status                   string     `json:"status" bson:"status"`
	CollectedAt              *time.Time `json:"collectedAt" bson:"collectedAt"`
	FulfilledAt              *time.Time `json:"fulfilledAt" bson:"fulfilledAt"`
	RetrialAttempts          int        `json:"retrialAttempts" bson:"retrialAttempts"`
	Owner                    *int       `json:"owner" bson:"owner"`
	CreatedAt                time.Time  `json:"createdAt" bson:"createdAt"`
	UpdatedAt                time.Time  `json:"updatedAt" bson:"updatedAt"`
	DeletedAt                *time.Time `json:"deletedAt" bson:"deletedAt"`
}

Message represents message object stores in database

type PublishEventParams

type PublishEventParams struct {
	TopicName      string
	Action         string
	Body           []byte
	Metadata       map[string]string
	CallerFunction string
}

PublishEventParams encapsulate parameters in publish event method

Jump to

Keyboard shortcuts

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