Documentation ¶
Index ¶
- func ChmodIfPermissionMismatch(targetPath string, mode os.FileMode) error
- func GetServerFromSource(server string) string
- func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func ParseEndpoint(endpoint string) (string, string, error)
- type Config
- type Metadata
- type S3Client
- func (c *S3Client) CreateBucket(bucketName string) error
- func (c *S3Client) CreatePrefix(bucketName, prefix string) error
- func (c *S3Client) DeleteBucket(bucketName string) error
- func (c *S3Client) DeletePrefix(bucketName, prefix string) error
- func (c *S3Client) IsBucketExist(bucketName string) (bool, error)
- type VolumeLocks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChmodIfPermissionMismatch ¶
ChmodIfPermissionMismatch checks the permission of the targetPath and chmod it if it's different from the mode.
func GetServerFromSource ¶
GetServerFromSource returns the server address from the source.
func LogGRPC ¶
func LogGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
LogGRPC is a middleware function that logs the details of a gRPC call. It logs the method, request, and response using the klog package. The log level is determined based on the method. It returns the response and any error from the handler.
Types ¶
type Config ¶
type Config struct { AccessKeyID string SecretAccessKey string Region string Endpoint string Mounter string }
Config holds values to configure the driver
type Metadata ¶
type Metadata struct { BucketName string `json:"Name"` Prefix string `json:"Prefix"` Mounter string `json:"Mounter"` MountOptions []string `json:"MountOptions"` CapacityBytes int64 `json:"CapacityBytes"` }
Metadata holds the metadata of a volume
type S3Client ¶
S3Client is a client
func NewClientFromSecrets ¶
NewClientFromSecrets creates a new S3Client from secrets
func NewS3Client ¶
NewS3Client creates a new S3Client
func (*S3Client) CreateBucket ¶
CreateBucket creates a new bucket
func (*S3Client) CreatePrefix ¶
CreatePrefix creates a new prefix
func (*S3Client) DeleteBucket ¶
DeleteBucket deletes a bucket
func (*S3Client) DeletePrefix ¶
DeletePrefix deletes a prefix
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) IsLocked ¶
func (v *VolumeLocks) IsLocked(volumeID string) bool
IsLocked returns true if the volume is locked.
func (*VolumeLocks) Release ¶
func (v *VolumeLocks) Release(volumeID string)
Release releases the lock for the volume.
func (*VolumeLocks) TryAcquire ¶
func (v *VolumeLocks) TryAcquire(volumeID string) bool
TryAcquire tries to acquire the lock for the volume. If the lock is already
func (*VolumeLocks) Unlock ¶
func (v *VolumeLocks) Unlock(volumeID string)
Unlock unlocks the volume.