Documentation
¶
Index ¶
- func Build(config storage.ProviderConfig) (*providerClientService, *providerResolver, error)
- func NewProvider(ctx context.Context, provider storage.ProviderType, ...) (storage.Provider, error)
- func NewServiceFromConfig(config storage.ProviderConfig, opts ...Option) (*objects.Service, error)
- type BuilderOption
- type Option
- type RuleOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(config storage.ProviderConfig) (*providerClientService, *providerResolver, error)
Build constructs the cp client service and provider resolver from runtime configuration.
func NewProvider ¶
func NewProvider(ctx context.Context, provider storage.ProviderType, providers storage.Providers, opts ...BuilderOption) (storage.Provider, error)
NewProvider builds one storage provider from the provider set, selecting the entry for the provider type
func NewServiceFromConfig ¶
NewServiceFromConfig constructs a storage service complete with resolver rules derived from runtime configuration.
Types ¶
type BuilderOption ¶
type BuilderOption func(*providerBuilders)
BuilderOption customises the provider builders NewProvider selects from
func WithGCSOptions ¶
func WithGCSOptions(opts ...gcs.Option) BuilderOption
WithGCSOptions applies provider options to the GCS builder
func WithR2Options ¶
func WithR2Options(opts ...r2provider.Option) BuilderOption
WithR2Options applies provider options to the R2 builder
func WithS3Options ¶
func WithS3Options(opts ...s3provider.Option) BuilderOption
WithS3Options applies provider options to the S3 builder
type Option ¶
type Option func(*serviceOptions)
func WithPresignBaseURL ¶
WithPresignBaseURL configures the base URL for presigned download URLs.
func WithPresignConfig ¶
func WithPresignConfig(tokenManager func() *tokens.TokenManager, issuer, audience string) Option
WithPresignConfig configures presigned URL token generation for providers that support it.
type RuleOption ¶
type RuleOption func(*ruleCoordinator)
RuleOption configures aspects of ruleCoordinator
func WithProviderBuilders ¶
func WithProviderBuilders(builders providerBuilders) RuleOption
WithProviderBuilders supplies the provider builders used for rule resolution.
func WithProviderConfig ¶
func WithProviderConfig(config storage.ProviderConfig) RuleOption
WithProviderConfig supplies the provider configuration used when resolving options.
func WithRuntimeOptions ¶
func WithRuntimeOptions(runtime serviceOptions) RuleOption
WithRuntimeOptions supplies runtime configuration such as token manager hooks.