objectstores3caller

package
v0.0.0-...-23dbee4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a manifold whose worker wraps an S3 Session.

func NewS3Client

func NewS3Client(endpoint string, client s3client.HTTPClient, creds s3client.Credentials, logger logger.Logger) (objectstore.Session, error)

NewS3Client returns a new S3 client based on the supplied dependencies.

func NewWorker

func NewWorker(config workerConfig) (worker.Worker, error)

NewWorker returns a new worker that wraps an S3 Session.

Types

type ControllerConfigService

type ControllerConfigService interface {
	// ControllerConfig returns the current controller configuration.
	ControllerConfig(context.Context) (controller.Config, error)
	// WatchControllerConfig returns a watcher that returns keys for any changes
	// to controller config.
	WatchControllerConfig() (watcher.StringsWatcher, error)
}

ControllerConfigService is the interface that the worker uses to get the controller configuration.

func GetControllerConfigService

func GetControllerConfigService(getter dependency.Getter, name string) (ControllerConfigService, error)

GetControllerConfigService is a helper function that gets a service from the manifold.

type GetControllerConfigServiceFunc

type GetControllerConfigServiceFunc = func(getter dependency.Getter, name string) (ControllerConfigService, error)

GetControllerConfigServiceFunc is a helper function that gets a service from the manifold.

type ManifoldConfig

type ManifoldConfig struct {
	HTTPClientName          string
	ObjectStoreServicesName string

	// NewClient is used to create a new object store client.
	NewClient NewClientFunc
	// Logger is used to write logging statements for the worker.
	Logger logger.Logger
	// Clock is used for the retry mechanism.
	Clock clock.Clock

	// GetControllerConfigService is used to get a service from the manifold.
	GetControllerConfigService GetControllerConfigServiceFunc
	NewWorker                  NewWorkerFunc
}

ManifoldConfig defines a Manifold's dependencies.

func (ManifoldConfig) Validate

func (cfg ManifoldConfig) Validate() error

type NewClientFunc

type NewClientFunc = func(endpoint string, client s3client.HTTPClient, creds s3client.Credentials, logger logger.Logger) (objectstore.Session, error)

NewClientFunc is a function that returns a new S3 client.

type NewWorkerFunc

type NewWorkerFunc = func(workerConfig) (worker.Worker, error)

NewWorkerFunc is a function that returns a new worker.

Jump to

Keyboard shortcuts

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