s3

package
v0.0.0-...-298fb53 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataName = ".metadata.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FSMeta

type FSMeta struct {
	BucketName    string `json:"name"`
	Prefix        string `json:"prefix"`
	UsePrefix     bool   `json:"useprefix"`
	Mounter       string `json:"mounter"`
	FSPath        string `json:"fspath"`
	CapacityBytes int64  `json:"capacitybytes"`
}

type S3Client

type S3Client struct {
	Config *S3Config
	Minio  *minio.Client
}

func CreateClient

func CreateClient(cfg *config.DriverConfig, secret map[string]string) (*S3Client, error)

func CreateClientFromConfig

func CreateClientFromConfig(cfg *S3Config) (*S3Client, error)

func (*S3Client) BucketExists

func (c *S3Client) BucketExists(ctx context.Context, bucketName string) (bool, error)

func (*S3Client) CreateBucket

func (c *S3Client) CreateBucket(ctx context.Context, bucketName string) error

func (*S3Client) CreatePrefix

func (c *S3Client) CreatePrefix(ctx context.Context, bucketName string, prefix string) error

func (*S3Client) GetFSMeta

func (c *S3Client) GetFSMeta(ctx context.Context, bucketName, prefix string) (*FSMeta, error)

func (*S3Client) RemoveBucket

func (c *S3Client) RemoveBucket(ctx context.Context, bucketName string) error

func (*S3Client) RemoveObjects

func (c *S3Client) RemoveObjects(ctx context.Context, bucketName, prefix string) error

func (*S3Client) RemoveObjectsOneByOne

func (c *S3Client) RemoveObjectsOneByOne(ctx context.Context, bucketName, prefix string) error

func (*S3Client) RemovePrefix

func (c *S3Client) RemovePrefix(ctx context.Context, bucketName string, prefix string) error

func (*S3Client) SetFSMeta

func (c *S3Client) SetFSMeta(ctx context.Context, meta *FSMeta) error

type S3Config

type S3Config struct {
	Endpoint        string `json:"endpoint"`
	Region          string `json:"region"`
	AccessKeyID     string `json:"accesskey"`
	SecretAccessKey string `json:"secretkey"`
	Mounter         string `json:"mounter"`
}

Jump to

Keyboard shortcuts

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