minio

package
v0.0.0-...-f839e32 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBucketNameError

func GetBucketNameError(bucket string) error

GetBucketNameError returns an error with description in case bucket name is not valid according to AWS s3 bucket naming rules. https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html

func GetObjectNameError

func GetObjectNameError(object string) error

GetObjectNameError returns an error with description in case object name is not valid according to AWS s2 object naming rules.

func IsBucketNameValid

func IsBucketNameValid(bucket string) bool

IsBucketNameValid checks whether bucket name is valid according to AWS s3 bucket naming rules. https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html

func IsObjectNameValid

func IsObjectNameValid(object string) bool

IsObjectNameValid checks whether object name is valid according to AWS s2 object naming rules.

func PathJoin

func PathJoin(elem ...string) string

PathJoin joins object path components

Types

type Accessor

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

func NewAccessor

func NewAccessor(mi *MinIO, s3address *common.S3Address) (*Accessor, error)

NewAccessor

func (*Accessor) Close

func (a *Accessor) Close() error

Close

type DataChunkTransport

type DataChunkTransport struct {
	Accessor
}

func NewDataChunkTransport

func NewDataChunkTransport(mi *MinIO, s3address *common.S3Address) *DataChunkTransport

NewDataChunkTransport

func (*DataChunkTransport) Recv

func (t *DataChunkTransport) Recv() (*common.DataChunk, error)

Recv

func (*DataChunkTransport) Send

func (t *DataChunkTransport) Send(dataChunk *common.DataChunk) error

Send puts each data chunk into own unique-UUID-named object in bucket and appends object to slice of chunks

type File

type File struct {
	Accessor
}

File Inspired by os.File handler and is expected to be used in the same context.

func OpenFile

func OpenFile(mi *MinIO, s3address *common.S3Address) (*File, error)

OpenFile

func (*File) Read

func (f *File) Read(p []byte) (int, error)

Read

func (*File) ReadFrom

func (f *File) ReadFrom(src io.Reader) (int64, error)

ReadFrom reads data from src

func (*File) Write

func (f *File) Write(p []byte) (int, error)

Write

func (*File) WriteTo

func (f *File) WriteTo(dst io.Writer) (int64, error)

WriteTo writes data to dst

type MinIO

type MinIO struct {
	Endpoint         string
	Secure           bool
	AccessKeyID      string
	SecretAccessKey  string
	BucketAutoCreate bool
	Region           string
	Perm             os.FileMode
	// contains filtered or unexported fields
}

MinIO specifies MinIO/S3 access structure

func NewMinIO

func NewMinIO(
	endpoint string,
	secure bool,
	insecureSkipVerify bool,
	accessKeyID,
	secretAccessKey string,
	bucketAutoCreate bool,
	region string,
) (*MinIO, error)

NewMinIO creates new MinIO

func NewMinIOFromConfig

func NewMinIOFromConfig(cfg sections.MinIOConfigurator) (*MinIO, error)

NewMinIOFromConfig creates new MinIO from config

func (*MinIO) BufferGet

func (m *MinIO) BufferGet(bucketName, objectName string) (*bytes.Buffer, error)

BufferGet downloads specified object into memory buffer

func (*MinIO) BufferGetA

func (m *MinIO) BufferGetA(addr *common.S3Address) (*bytes.Buffer, error)

BufferGetA downloads specified object into memory buffer

func (*MinIO) Copy

func (m *MinIO) Copy(dstBucketName, dstObjectName, srcBucketName, srcObjectName string) error

Copy copies specified src object into specified dst object

func (*MinIO) CopyA

func (m *MinIO) CopyA(dst, src *common.S3Address) error

CopyA copies specified src object into specified dst object

func (*MinIO) CreateBucket

func (m *MinIO) CreateBucket(bucketName string) error

CreateBucket creates specified bucket

func (*MinIO) Digest

func (m *MinIO) Digest(bucketName, objectName string, _type common.DigestType) (*common.Digest, error)

Digest calculates digest of the specified object

func (*MinIO) DigestA

func (m *MinIO) DigestA(addr *common.S3Address, _type common.DigestType) (*common.Digest, error)

DigestA calculates digest of the specified object

func (*MinIO) FGet

func (m *MinIO) FGet(bucketName, objectName, fileName string) error

FGet downloads specified object into specified file

func (*MinIO) FGetA

func (m *MinIO) FGetA(addr *common.S3Address, fileName string) error

FGetA downloads specified object into specified file

func (*MinIO) FGetTempFile

func (m *MinIO) FGetTempFile(bucketName, objectName, dir, pattern string) (string, error)

FGetTempFile downloads specified object into temp file created in specified dir with name pattern See ioutil.TempFile() for more into about dir and name pattern

func (*MinIO) FGetTempFileA

func (m *MinIO) FGetTempFileA(addr *common.S3Address, dir, pattern string) (string, error)

FGetTempFileA downloads specified object into temp file created in specified dir with name pattern See ioutil.TempFile() for more into about dir and name pattern

func (*MinIO) FPut

func (m *MinIO) FPut(bucketName, objectName, fileName string) (int64, error)

FPut creates specified object from the file

func (*MinIO) FPutA

func (m *MinIO) FPutA(addr *common.S3Address, fileName string) (int64, error)

FPutA creates specified object from the file

func (*MinIO) FPutUUID

func (m *MinIO) FPutUUID(bucketName, path, fileName string) (*common.S3Address, int64, error)

FPutUUID creates object in specified bucket named by generated UUID from the file

func (*MinIO) FPutUUIDA

func (m *MinIO) FPutUUIDA(addr *common.S3Address, fileName string) (*common.S3Address, int64, error)

FPutUUIDA creates object in specified bucket named by generated UUID from the file

func (*MinIO) Get

func (m *MinIO) Get(bucketName, objectName string) (io.Reader, error)

Get returns reader for specified object

func (*MinIO) GetA

func (m *MinIO) GetA(addr *common.S3Address) (io.Reader, error)

GetA returns reader for specified object

func (*MinIO) List

func (m *MinIO) List(bucket, prefix string, n int) ([]minio.ObjectInfo, error)

List at max n objects from a bucket having specified name prefix.

func (*MinIO) ListBuckets

func (m *MinIO) ListBuckets() ([]string, error)

ListBuckets lists all buckets

func (*MinIO) Move

func (m *MinIO) Move(dstBucketName, dstObjectName, srcBucketName, srcObjectName string) error

Move moves specified src object into specified dst object

func (*MinIO) MoveA

func (m *MinIO) MoveA(dst, src *common.S3Address) error

MoveA moves specified src object into specified dst object

func (*MinIO) Put

func (m *MinIO) Put(bucketName, objectName string, reader io.Reader) (int64, error)

Put creates specified object from the reader

func (*MinIO) PutA

func (m *MinIO) PutA(addr *common.S3Address, reader io.Reader) (int64, error)

PutA creates specified object from the reader

func (*MinIO) PutUUID

func (m *MinIO) PutUUID(bucketName string, path string, reader io.Reader) (*common.S3Address, int64, error)

PutUUID creates object in specified bucket named by generated UUID from the reader

func (*MinIO) PutUUIDA

func (m *MinIO) PutUUIDA(addr *common.S3Address, reader io.Reader) (*common.S3Address, int64, error)

PutUUIDA creates object in specified bucket named by generated UUID from the reader

func (*MinIO) Remove

func (m *MinIO) Remove(bucketName, objectName string) error

Remove removes/deletes specified object

func (*MinIO) RemoveA

func (m *MinIO) RemoveA(addr *common.S3Address) error

RemoveA removes/deletes specified object

func (*MinIO) RemoveBucket

func (m *MinIO) RemoveBucket(bucketName string) error

RemoveBucket removes/deletes specified bucket

Jump to

Keyboard shortcuts

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