Documentation
¶
Overview ¶
*
- Copyright 2021 IBM Corp. *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- https://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
func (*COSSession) CheckObjectPathExistence ¶
func (s *COSSession) CheckObjectPathExistence(bucket string, objectpath string) (bool, error)
func (*COSSession) CreateBucket ¶
func (s *COSSession) CreateBucket(bucket string) (string, error)
func (*COSSession) DeleteBucket ¶
func (s *COSSession) DeleteBucket(bucket string) error
type COSSessionFactory ¶
type COSSessionFactory struct{}
COSSessionFactory represents a COS (S3) session factory
func NewObjectStorageSessionFactory ¶
func NewObjectStorageSessionFactory() *COSSessionFactory
func (*COSSessionFactory) NewObjectStorageSession ¶
func (s *COSSessionFactory) NewObjectStorageSession(endpoint, locationConstraint string, creds *ObjectStorageCredentials, lgr *zap.Logger) ObjectStorageSession
NewObjectStorageSession method creates a new object store session
type ObjectStorageCredentials ¶
type ObjectStorageCredentials struct {
//AuthType
AuthType string
// 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 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
func NewS3Client ¶
func NewS3Client(lgr *zap.Logger) (ObjectStorageSession, error)
type ObjectStorageSessionFactory ¶
type ObjectStorageSessionFactory interface {
// NewObjectStorageBackend method creates a new object store session
NewObjectStorageSession(endpoint, locationConstraint string, creds *ObjectStorageCredentials, lgr *zap.Logger) ObjectStorageSession
}
ObjectStorageSessionFactory is an interface of an object store session factory
Click to show internal directories.
Click to hide internal directories.