backend

package
v0.0.0-...-bafb2d1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const IAMEPForVPC = "https://private.iam.cloud.ibm.com/identity/token"
View Source
const Private = "private"
View Source
const ResourceConfigEPDirect = "https://config.direct.cloud-object-storage.cloud.ibm.com/v1"
View Source
const ResourceConfigEPPrivate = "https://config.private.cloud-object-storage.cloud.ibm.com/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessPolicy

type AccessPolicy interface {
	UpdateAccessPolicy(allowedIps, apiKey, bucketName string, rcc ResourceConfigurationV1) error
	UpdateQuotaLimit(quota int64, apiKey, bucketName, osEndpoint, iamEndpoint string, rcc ResourceConfigurationV1) error
}

type AccessPolicyFactory

type AccessPolicyFactory interface {
	NewAccessPolicy() AccessPolicy
}

type COSSession

type COSSession struct {
	// contains filtered or unexported fields
}

COSSession represents a COS (S3) session

func (*COSSession) CheckBucketAccess

func (s *COSSession) CheckBucketAccess(bucket string) error

CheckBucketAccess method check that a bucket can be accessed

func (*COSSession) CheckObjectPathExistence

func (s *COSSession) CheckObjectPathExistence(bucket, objectpath string) (bool, error)

CheckObjectPathExistence method checks that object-path exists inside bucket

func (*COSSession) CreateBucket

func (s *COSSession) CreateBucket(bucket, locationConstraint string, kpRootKeyCrn string) (string, error)

CreateBucket methods creates a new bucket

func (*COSSession) DeleteBucket

func (s *COSSession) DeleteBucket(bucket string) error

DeleteBucket methods deletes a bucket (with all of its objects)

type COSSessionFactory

type COSSessionFactory struct{}

COSSessionFactory represents a COS (S3) session factory

func (*COSSessionFactory) NewObjectStorageSession

func (s *COSSessionFactory) NewObjectStorageSession(endpoint, region string, creds *ObjectStorageCredentials, logger *zap.Logger) ObjectStorageSession

NewObjectStorageSession method creates a new object store session

type ObjectStorageCredentials

type ObjectStorageCredentials struct {
	// AccessKey is the account identifier in AWS authentication
	AccessKey string
	// SecretKey is the "password" in AWS authentication
	SecretKey string
	// APIKey is the "password" in IBM IAM authentication
	APIKey string
	// ServiceInstanceID is the account identifier in IBM IAM authentication
	ServiceInstanceID string
	//IAMEndpoint ...
	IAMEndpoint string
}

ObjectStorageCredentials holds credentials for accessing an object storage service

type ObjectStorageSession

type ObjectStorageSession interface {

	// CheckBucketAccess method check that a bucket can be accessed
	CheckBucketAccess(bucket string) error

	// CheckObjectPathExistence method checks that object-path exists inside bucket
	CheckObjectPathExistence(bucket, objectpath string) (bool, error)

	// CreateBucket methods creates a new bucket
	CreateBucket(bucket, locationConstraint string, kpRootKeyCrn string) (string, error)

	// DeleteBucket methods deletes a bucket (with all of its objects)
	DeleteBucket(bucket string) error
}

ObjectStorageSession is an interface of an object store session

type ObjectStorageSessionFactory

type ObjectStorageSessionFactory interface {

	// NewObjectStorageBackend method creates a new object store session
	NewObjectStorageSession(endpoint, region string, creds *ObjectStorageCredentials, logger *zap.Logger) ObjectStorageSession
}

ObjectStorageSessionFactory is an interface of an object store session factory

type ResourceConfigurationV1

type ResourceConfigurationV1 interface {
	// UpdateBucketConfig updates the bucket access policy configuration with given ips
	UpdateBucketConfig(*rc.ResourceConfigurationV1, *rc.UpdateBucketConfigOptions) (*core.DetailedResponse, error)
}

type UpdateAPFactory

type UpdateAPFactory struct{}

func (*UpdateAPFactory) NewAccessPolicy

func (c *UpdateAPFactory) NewAccessPolicy() AccessPolicy

type UpdateAPObj

type UpdateAPObj struct {
	// contains filtered or unexported fields
}

func (*UpdateAPObj) UpdateAccessPolicy

func (c *UpdateAPObj) UpdateAccessPolicy(allowedIps, apiKey, bucketName string, rcc ResourceConfigurationV1) error

UpdateAccessPolicy updates the bucket access policy configuration with given ips

func (*UpdateAPObj) UpdateBucketConfig

func (uc *UpdateAPObj) UpdateBucketConfig(service *rc.ResourceConfigurationV1, options *rc.UpdateBucketConfigOptions) (res *core.DetailedResponse, err error)

func (*UpdateAPObj) UpdateQuotaLimit

func (c *UpdateAPObj) UpdateQuotaLimit(quota int64, apiKey, bucketName, osEndpoint, iamEndpoint string, rcc ResourceConfigurationV1) error

UpdateQuotaLimit updates the bucket quota limits

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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