minio

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// domain of s3 compatible api
	S3Host = "s3.amazonaws.com"
	GSHost = "storage.googleapis.com"
)

Functions

func ListFiles

func ListFiles(pth string, opt Option) ([]stat.Stats, error)

ListFiles will list all file objects in the provided pth directory. pth is assumed to be a directory and so a trailing "/" is appended if one does not already exist.

func Stat

func Stat(pth string, Opt Option) (stat.Stats, error)

Stat a directory or file for additional information

Types

type Option

type Option struct {
	//	*buf.Options
	Host      string
	AccessKey string
	SecretKey string
	Secure    bool
}

type Reader

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

Reader will read in streamed bytes from the s3 object.NewS3Client

func NewReader

func NewReader(pth string, opt Option) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close() (err error)

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

func (*Reader) ReadLine

func (r *Reader) ReadLine() (ln []byte, err error)

func (*Reader) Stats

func (r *Reader) Stats() stat.Stats

type Writer

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

Writer will write to local buffer first and will copy all the written contents to the S3 destination after calling Close(). Close() must be called in order for the written contents to be written to S3.

Calling Abort() before Close() will cleanup the buffer. Calling Close() after Abort() will not result in any writing to S3.

Calling Abort() after Close() will do nothing.

func NewWriter

func NewWriter(pth string, mOpt Option, opt *buf.Options) (*Writer, error)

func (*Writer) Abort

func (w *Writer) Abort() (err error)

Abort will: - clear and close buffer

Calling Close after Abort will do nothing. Writing after calling Abort has undefined behavior.

func (*Writer) Close

func (w *Writer) Close() error

Close will: - calculate final checksum - copy (mv) buffer to pth file - clear and close buffer - report any errors

If an error is returned it should be assumed that S3 object writing failed.

Calling Abort after Close will do nothing. Writing after calling Close has undefined behavior.

func (*Writer) Stats

func (w *Writer) Stats() stat.Stats

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

func (*Writer) WriteLine

func (w *Writer) WriteLine(ln []byte) (err error)

Jump to

Keyboard shortcuts

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