Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationDetailsReader ¶ added in v0.0.7
type AuthenticationDetailsReader interface { // Read reads the authentication details to connect to the instance. Read(ctx context.Context, instanceID string) (accessKeyID, secretAccessKey string, err error) }
AuthenticationDetailsReader defines the port to read auth details to connect to the storage instance.
type Gateway ¶
func New ¶
func New( storageInstancesSelector string, storageBucket string, serviceRegistryClient ServiceRegistryScanner, connectionDetailsReader AuthenticationDetailsReader, newStorageConnectionFn StorageConnectionFn, logger *slog.Logger, ) (*Gateway, error)
New initializes a Gateway.
type ObjectReadWriteFinder ¶
type ObjectReadWriteFinder interface { // Read reads the object. Read(ctx context.Context, bucketName, objectName string) (io.ReadCloser, bool, error) // Write writes the object. Write(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSizeBytes int64) error // Find identifies if the object can be found in the instance. Find(ctx context.Context, bucketName, objectName string) (bool, error) }
ObjectReadWriteFinder defines the port to the storage instance.
type ServiceRegistryScanner ¶ added in v0.0.7
type ServiceRegistryScanner interface { // Scan scans the "service discovery" records to find instances and return the map ID -> IP address. Scan(ctx context.Context, serviceLabelFilter string) (map[string]string, error) }
ServiceRegistryScanner defines the port to query the service registry.
type StorageConnectionFn ¶
type StorageConnectionFn func(endpoint, accessKeyID, secretAccessKey string) (ObjectReadWriteFinder, error)
StorageConnectionFn defines the factory of ObjectReadWriteFinder.
Click to show internal directories.
Click to hide internal directories.