Documentation
¶
Index ¶
- func NewCredsSvc(ctx context.Context, conf *Config, rc redis.UniversalClient) (*credsSvc, error)
- func NewRegistry(ctx context.Context, creds CredsService, metricsSvc metrics.Service) (*clients, error)
- func StorageTypeFromRequest(r *http.Request) dom.StorageType
- type Clients
- type Common
- type CommonConfig
- type Config
- type CredsService
- type DynamicCredentialsConfig
- type GenericStorage
- type Storage
- type StorageConfig
- type StoragesConfig
- func (s StoragesConfig[S3Config, SwiftConfig]) Exists(stor, user string) error
- func (s StoragesConfig[S3conf, SwiftConf]) GetMain() GenericStorage[S3conf, SwiftConf]
- func (s StoragesConfig[_, _]) RateLimitConf() map[string]ratelimit.RateLimit
- func (s StoragesConfig[S3conf, SwiftConf]) S3Storages() map[string]S3conf
- func (s StoragesConfig[S3conf, SwiftConf]) SwiftStorages() map[string]SwiftConf
- func (s StoragesConfig[S3Config, SwiftConfig]) Types() map[string]dom.StorageType
- func (s StoragesConfig[_, _]) Validate() error
- func (s StoragesConfig[S3Config, SwiftConfig]) ViperUnmarshallerHookFunc() mapstructure.DecodeHookFuncType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCredsSvc ¶
func NewRegistry ¶
func NewRegistry(ctx context.Context, creds CredsService, metricsSvc metrics.Service) (*clients, error)
TODO: TODO-DC: todos for dynamic credentials support: - use DynamicCredeintilas Service everywhere instead of using Storage Config directly - use this Clients registry everywhere instead of using providers directly After done, make sure that: - Storage config is used only in this package. Other packages use only DynamicCredentials Service - Storage clients (S3|Swift) not instanitated outside of this package Then: - implement management API for dynamic credentials - add e2e tests
func StorageTypeFromRequest ¶
func StorageTypeFromRequest(r *http.Request) dom.StorageType
StorageTypeFromRequest detects storage type from http request
Types ¶
type Common ¶
type Common interface {
BucketExists(ctx context.Context, bucket string) (bool, error)
ListBuckets(ctx context.Context) ([]string, error)
}
Common - common object storage client interface
type CommonConfig ¶
type CommonConfig struct {
Type dom.StorageType `yaml:"type"`
RateLimit ratelimit.RateLimit `yaml:"rateLimit"`
}
type CredsService ¶
type CredsService interface {
FindS3Credentials(storage, accessKey string) (user string, cred s3.CredentialsV4, err error)
MainStorage() string
Storages() map[string]dom.StorageType
GetS3Address(storage string) (s3.StorageAddress, error)
GetSwiftAddress(storage string) (swift.StorageAddress, error)
ValidateReplicationID(id entity.UniversalReplicationID) error
HasUser(storage, user string) error
ListUsers(storage string) []string
GetSwiftCredentials(storage, user string) (swift.Credentials, error)
GetS3Credentials(storage, user string) (s3.CredentialsV4, error)
SetSwiftCredentials(ctx context.Context, storage, user string, cred swift.Credentials) error
SetS3Credentials(ctx context.Context, storage, user string, cred s3.CredentialsV4) error
}
type DynamicCredentialsConfig ¶
type DynamicCredentialsConfig struct {
MasterPassword string `yaml:"masterPassword"`
PollInterval time.Duration `yaml:"pollInterval"`
Enabled bool `yaml:"enabled"`
DisableEncryption bool `yaml:"disableEncryption"`
}
func (*DynamicCredentialsConfig) Validate ¶
func (c *DynamicCredentialsConfig) Validate() error
type GenericStorage ¶
type GenericStorage[ S3Config StorageConfig, SwiftConfig StorageConfig, ] struct { S3 S3Config Swift SwiftConfig CommonConfig }
func (GenericStorage[S3conf, SwiftConf]) MarshalYAML ¶
func (a GenericStorage[S3conf, SwiftConf]) MarshalYAML() (any, error)
func (*GenericStorage[S3conf, SwiftConf]) UnmarshalYAML ¶
func (s *GenericStorage[S3conf, SwiftConf]) UnmarshalYAML(node *yaml.Node) error
func (GenericStorage[S3conf, SwiftConf]) UserList ¶
func (a GenericStorage[S3conf, SwiftConf]) UserList() []string
func (GenericStorage[S3Config, SwiftConfig]) Validate ¶
func (s GenericStorage[S3Config, SwiftConfig]) Validate() error
type StorageConfig ¶
type StorageConfig interface {
Validate() error
UserList() []string
HasUser(user string) bool
comparable
}
type StoragesConfig ¶
type StoragesConfig[ S3Config StorageConfig, SwiftConfig StorageConfig, ] struct { Storages map[string]GenericStorage[S3Config, SwiftConfig] `yaml:"storages"` Main string `yaml:"main"` DynamicCredentials DynamicCredentialsConfig `yaml:"dynamicCredentials"` }
func (StoragesConfig[S3Config, SwiftConfig]) Exists ¶
func (s StoragesConfig[S3Config, SwiftConfig]) Exists(stor, user string) error
func (StoragesConfig[S3conf, SwiftConf]) GetMain ¶
func (s StoragesConfig[S3conf, SwiftConf]) GetMain() GenericStorage[S3conf, SwiftConf]
func (StoragesConfig[_, _]) RateLimitConf ¶
func (s StoragesConfig[_, _]) RateLimitConf() map[string]ratelimit.RateLimit
func (StoragesConfig[S3conf, SwiftConf]) S3Storages ¶
func (s StoragesConfig[S3conf, SwiftConf]) S3Storages() map[string]S3conf
func (StoragesConfig[S3conf, SwiftConf]) SwiftStorages ¶
func (s StoragesConfig[S3conf, SwiftConf]) SwiftStorages() map[string]SwiftConf
func (StoragesConfig[S3Config, SwiftConfig]) Types ¶
func (s StoragesConfig[S3Config, SwiftConfig]) Types() map[string]dom.StorageType
func (StoragesConfig[_, _]) Validate ¶
func (s StoragesConfig[_, _]) Validate() error
func (StoragesConfig[S3Config, SwiftConfig]) ViperUnmarshallerHookFunc ¶
func (s StoragesConfig[S3Config, SwiftConfig]) ViperUnmarshallerHookFunc() mapstructure.DecodeHookFuncType
Click to show internal directories.
Click to hide internal directories.