Documentation
¶
Index ¶
- Variables
- func NewMinioFs(ctx context.Context, dsn string) (afero.Fs, error)
- func NewMinioFsWithOptions(ctx context.Context, dsn string, opts Options) (afero.Fs, error)
- func NewPathError(op, path string, err error) error
- func ParseURL(minioURL string) (*minio.Options, error)
- type AppendStrategy
- type ByName
- type FileInfo
- type Fs
- func (fs *Fs) Chmod(_ string, _ os.FileMode) error
- func (fs *Fs) Chown(_ string, _, _ int) error
- func (fs *Fs) Chtimes(_ string, _, _ time.Time) error
- func (fs *Fs) Create(name string) (afero.File, error)
- func (fs *Fs) Mkdir(name string, _ os.FileMode) error
- func (fs *Fs) MkdirAll(name string, _ os.FileMode) error
- func (fs *Fs) Name() string
- func (fs *Fs) Open(name string) (afero.File, error)
- func (fs *Fs) OpenFile(name string, flag int, fileMode os.FileMode) (afero.File, error)
- func (fs *Fs) Remove(name string) error
- func (fs *Fs) RemoveAll(pathName string) error
- func (fs *Fs) Rename(oldName, newName string) error
- func (fs *Fs) Stat(name string) (os.FileInfo, error)
- type LargeObjectStrategy
- type MinioFile
- func (o *MinioFile) Close() error
- func (o *MinioFile) Name() string
- func (o *MinioFile) Read(p []byte) (int, error)
- func (o *MinioFile) ReadAt(p []byte, off int64) (int, error)
- func (o *MinioFile) ReadFrom(src io.Reader) (int64, error)
- func (o *MinioFile) Readdir(count int) ([]os.FileInfo, error)
- func (o *MinioFile) Readdirnames(n int) ([]string, error)
- func (o *MinioFile) Seek(offset int64, whence int) (int64, error)
- func (o *MinioFile) Stat() (os.FileInfo, error)
- func (o *MinioFile) Sync() error
- func (o *MinioFile) Truncate(size int64) error
- func (o *MinioFile) Write(p []byte) (int, error)
- func (o *MinioFile) WriteAt(p []byte, off int64) (int, error)
- func (o *MinioFile) WriteString(s string) (int, error)
- func (o *MinioFile) WriteTo(dst io.Writer) (int64, error)
- type Options
- type PathError
- type WriteStrategy
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoBucketInName indicates no bucket was specified in the DSN ErrNoBucketInName = errors.New("miniofs: no bucket name found in the DSN") // ErrEmptyObjectName indicates an empty object name was provided ErrEmptyObjectName = errors.New("miniofs: object name is empty") // ErrFileClosed indicates operation on a closed file ErrFileClosed = os.ErrClosed // ErrOutOfRange indicates offset is out of valid range ErrOutOfRange = errors.New("miniofs: offset out of range") // ErrNotSupported indicates operation is not supported ErrNotSupported = errors.New("miniofs: operation not supported") // ErrInvalidSeekWhence indicates invalid whence parameter for Seek ErrInvalidSeekWhence = errors.New("miniofs: invalid seek whence") // ErrNegativeOffset indicates negative offset was provided ErrNegativeOffset = errors.New("miniofs: negative offset") // ErrReadOnlyFile indicates write operation on read-only file ErrReadOnlyFile = errors.New("miniofs: file opened as read-only") // ErrWriteOnlyFile indicates read operation on write-only file ErrWriteOnlyFile = errors.New("miniofs: file opened as write-only") // ErrContextCanceled indicates context was canceled ErrContextCanceled = errors.New("miniofs: context canceled") // ErrAppendNotSupported indicates append is unavailable with the current backend or strategy. ErrAppendNotSupported = errors.New("miniofs: append is not supported by the configured strategy") // ErrLargeWriteRequiresStaging indicates the write exceeds direct mode limits and needs another strategy. ErrLargeWriteRequiresStaging = errors.New("miniofs: large object mutation requires temp_file or compose append strategy") )
Functions ¶
func NewMinioFsWithOptions ¶
func NewPathError ¶
NewPathError creates a new PathError
func ParseURL ¶
ParseURL parses a MinIO DSN and returns minio.Options DSN format: scheme://accessKey:secretKey@endpoint/bucket?param=value Supported query parameters:
- region: AWS region (default: us-east-1)
- token: Session token for temporary credentials
- insecure: Disable TLS verification (true/false, default: false)
Types ¶
type AppendStrategy ¶
type AppendStrategy string
const ( AppendStrategyCompat AppendStrategy = "compat" AppendStrategyCompose AppendStrategy = "compose" AppendStrategyNative AppendStrategy = "native" AppendStrategyDisabled AppendStrategy = "disabled" )
type ByName ¶
type ByName []*FileInfo
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
func NewFsWithClients ¶
func NewFsWithOptions ¶
type LargeObjectStrategy ¶
type LargeObjectStrategy string
const ( LargeObjectStrategyError LargeObjectStrategy = "error" LargeObjectStrategyTempFile LargeObjectStrategy = "temp_file" LargeObjectStrategyCompose LargeObjectStrategy = "compose" )
type MinioFile ¶
type MinioFile struct {
// contains filtered or unexported fields
}
func NewMinioFile ¶
type Options ¶
type Options struct {
Prefix string
ValidateBucketOnInit bool
OperationTimeout time.Duration
BucketLookup minio.BucketLookupType
MaxRetries int
Transport http.RoundTripper
AppName string
AppVersion string
TraceOutput io.Writer
DirectoryMarkers bool
WriteStrategy WriteStrategy
MaxDirectObjectSize int64
LargeObjectStrategy LargeObjectStrategy
TempDir string
AppendStrategy AppendStrategy
AssumeNativeAppendSupported bool
NativeAppendChunkSize uint64
StreamChunkSize uint64
OptimisticWriteOpen bool
StatCacheTTL time.Duration
DeferEmptyObjectWrite bool
// EnablePerfLog 启用性能日志输出(默认 false)
EnablePerfLog bool
}
func DefaultOptions ¶
func DefaultOptions() Options
type WriteStrategy ¶
type WriteStrategy string
const ( WriteStrategyDirect WriteStrategy = "direct" WriteStrategyStaging WriteStrategy = "staging" )
Click to show internal directories.
Click to hide internal directories.