Documentation
¶
Index ¶
- Constants
- Variables
- type CloudStorageAssessor
- func (csa *CloudStorageAssessor) Delete(ctx context.Context, key string) error
- func (csa *CloudStorageAssessor) Get(ctx context.Context, key string) (string, []byte, error)
- func (csa *CloudStorageAssessor) GetByStreaming(ctx context.Context, key string) (string, int, io.ReadCloser, error)
- func (csa *CloudStorageAssessor) GetObjectInfo(ctx context.Context, key string) (entity.StorageObjectInfo, error)
- func (csa *CloudStorageAssessor) Put(ctx context.Context, path string, file io.ReadSeeker) error
Constants ¶
View Source
const RecordNotFoundMsg = "status code: 404"
RecordNotFoundMsg define status 404 message.
Variables ¶
View Source
var ( ErrInvalidStorageType = errors.New("invalid storage type") ErrStorageTypeEmpty = errors.New("STORAGE_TYPE environment variable is not set") )
Sentinel errors for storage validation.
Functions ¶
This section is empty.
Types ¶
type CloudStorageAssessor ¶
type CloudStorageAssessor struct {
// contains filtered or unexported fields
}
CloudStorageAssessor struct.
func NewCloudStorageAssessor
deprecated
func NewCloudStorageAssessor() *CloudStorageAssessor
NewCloudStorageAssessor creates a new CloudStorageAssessor.
Deprecated: Use NewCloudStorageAssessorWithConfig for better error handling.
func NewCloudStorageAssessorForTest ¶ added in v1.11.2
func NewCloudStorageAssessorForTest(inst cloudstorages.StorageInstance) *CloudStorageAssessor
NewCloudStorageAssessorForTest creates a CloudStorageAssessor with the given instance for testing.
func NewCloudStorageAssessorWithConfig ¶ added in v1.10.4
func NewCloudStorageAssessorWithConfig(ctx context.Context) (*CloudStorageAssessor, error)
NewCloudStorageAssessorWithConfig creates a new CloudStorageAssessor with proper error handling.
func (*CloudStorageAssessor) Delete ¶
func (csa *CloudStorageAssessor) Delete(ctx context.Context, key string) error
Delete remove storage contents.
func (*CloudStorageAssessor) GetByStreaming ¶ added in v1.5.0
func (csa *CloudStorageAssessor) GetByStreaming(ctx context.Context, key string) (string, int, io.ReadCloser, error)
GetByStreaming returns storage contents by streaming.
func (*CloudStorageAssessor) GetObjectInfo ¶ added in v1.6.0
func (csa *CloudStorageAssessor) GetObjectInfo(ctx context.Context, key string) (entity.StorageObjectInfo, error)
GetObjectInfo returns storage contents info.
func (*CloudStorageAssessor) Put ¶
func (csa *CloudStorageAssessor) Put(ctx context.Context, path string, file io.ReadSeeker) error
Put puts storage contents.
Click to show internal directories.
Click to hide internal directories.