contract

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

PublishSubscribeInterface is a common interface that has to be implemented by all cloud vendor specific implementions (ie AWS, Azure, GCP). This interface provides a cloud agnostic approach to the workflow, where consumers of publish-subscribe cloud workflow do not have to know the exact cloud vendor, can work with the inteface signature itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfigInterface

type AppConfigInterface interface {
	FetchConfig(ctx context.Context, input *appconfig.FetchConfigInput) (*appconfig.FetchConfigResult, error)
	WatchConfig(ctx context.Context, input *appconfig.WatchConfigInput, callback func(result *appconfig.FetchConfigResult)) error
	GetCurrentConfiguration(uniqueConfigId string) (*appconfig.FetchConfigResult, error)
	StopWatching(id string) error
	StopAllWatching()
}

type EmailInterface

type EmailInterface interface {

	// SendSimpleEmail sends a basic email with plain text or HTML body (no attachments).
	SendSimpleEmail(ctx context.Context, input *email.SendSimpleEmailInput) (*email.SendEmailResult, error)

	// SendRawEmail sends a raw email (MIME format) with attachments or custom headers.
	SendRawEmail(ctx context.Context, input *email.SendRawEmailInput) (*email.SendEmailResult, error)
}

type MessageQueueInterface

type MessageQueueInterface interface {

	// Send single message to cloud message queue
	SendMessage(ctx context.Context, queueUrl string, messageBody string, messageGroupId string) (*messagequeue.SendMessageResult, error)

	// Receive multiple messages from cloud message queue
	ReceiveMessages(ctx context.Context, queueUrl string, maxItems int32) ([]*messagequeue.ReceiveMessageResult, error)

	// Delete single message from cloud message queue
	DeleteMessage(ctx context.Context, queueUrl string, receiptHandle string) (*messagequeue.DeleteMessageResult, error)

	// Change visibility timeout for a received message
	ChangeMessageVisibility(ctx context.Context, queueUrl string, receiptHandle string, visibilityTimeoutSeconds int32) (*messagequeue.ChangeMessageVisibilityResult, error)

	// Get message queue attributes
	GetQueueAttributes(ctx context.Context, queueUrl string) (*messagequeue.GetQueueAttributesResult, error)
}

MessageQueueInterface interface is a common interface that has to be implemented by all cloud vendor specific implementions (ie AWS, Azure, GCP). This interface provides a cloud agnostic approach to the workflow, where consumers of message queue cloud workflow do not have to know the exact cloud vendor, can work with the inteface signature itself.

type ObjectStorageInterface

type ObjectStorageInterface interface {

	// Get single object from cloud object store
	GetObject(ctx context.Context, bucket string, key string) (*objectstorage.GetObjectResult, error)

	// Get multiple objects (concurrently) from cloud object store
	GetMultipleObjects(ctx context.Context, bucket string, keys []string) ([]*objectstorage.GetObjectResult, error)

	// Put/upload single object to cloud object store
	PutObject(ctx context.Context, input *objectstorage.PutObjectInput) (*objectstorage.PutObjectResult, error)

	// Copy object from one location to another on cloud object store
	CopyObject(ctx context.Context, srcBucket string, srcObject string, destBucket string, destObject string) (*objectstorage.CopyObjectResult, error)

	// Get time-bound presigned url for any cloud object
	GetPresignedUrl(ctx context.Context, bucket string, key string, ttl time.Duration) (*objectstorage.GetPresignedUrlResult, error)

	// Get time-bound presigned url for direct object upload
	GetPresignedPutUrl(ctx context.Context, input *objectstorage.PresignedPutObjectInput) (*objectstorage.GetPresignedPutUrlResult, error)

	// Head object metadata without reading its body
	HeadObject(ctx context.Context, bucket string, key string) (*objectstorage.HeadObjectResult, error)

	// List all objects for provided prefix from cloud object store
	ListObject(ctx context.Context, bucket string, prefix string, maxObjects int32) (*objectstorage.ListObjectResult, error)
}

ObjectStorageInterface interface is a common interface that has to be implemented by all cloud vendor specific implementions (ie AWS, Azure, GCP). This interface provides a cloud agnostic approach to the workflow, where consumers of object store cloud workflow do not have to know the exact cloud vendor, can work with the inteface signature itself.

type PublishSubscribeInterface

type PublishSubscribeInterface interface {

	// Publish a message to a specified topic
	Publish(ctx context.Context, input *pubsub.PublishInput) (*pubsub.PublishResult, error)

	// Get topic attributes
	GetTopicAttributes(ctx context.Context, input *pubsub.GetTopicAttributesInput) (*pubsub.GetTopicAttributesResult, error)
}

PublishSubscribeInterface defines methods for a cloud notification service like AWS SNS.

type VisualAnalysisInterface

VisualAnalysisInterface is implemented by cloud providers that can analyse images.

Jump to

Keyboard shortcuts

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