miniofs

package module
v0.0.0-...-af77947 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MinIO SDK for Afero

Go Report Card GoDoc

English | 中文


English

About

A production-ready Afero filesystem implementation for MinIO object storage. This package provides a complete, drop-in afero.Fs interface backed by MinIO, enabling seamless integration with any code that uses afero abstractions.

Features

✅ Complete Implementation

  • ✓ Full afero.Fs interface support
  • ✓ File creation, reading, writing, deletion
  • ✓ Directory operations (Mkdir, MkdirAll, ReadDir)
  • ✓ File operations (Rename, Truncate, Stat)
  • ✓ Streaming reads and writes
  • ✓ Seeking support with optimizations
  • ✓ Comprehensive error handling

✅ Production Ready

  • ✓ Robust error handling
  • ✓ Proper boundary condition handling
  • ✓ Directory simulation using empty objects
  • ✓ Virtual directory detection
  • ✓ File-handle locking for seek/read/write state

✅ Well Tested

  • ✓ Unit tests and env-driven integration tests
  • ✓ Edge case coverage
  • ✓ Integration test support
Installation
go get github.com/cpyun/afero-minio
Quick Start
Method 1: Using DSN String
import (
    "context"
    "log"
    
    "github.com/cpyun/afero-minio"
    "github.com/spf13/afero"
)

func main() {
    // DSN format: scheme://accessKey:secretKey@endpoint/bucket?region=us-east-1
    dsn := "https://YOUR_ACCESS_KEY:YOUR_SECRET_KEY@play.min.io/my-bucket?region=us-east-1"
    
    fs, err := miniofs.NewMinioFs(context.Background(), dsn)
    if err != nil {
        log.Fatal(err)
    }
    
    // Use it like any afero.Fs
    err = afero.WriteFile(fs, "hello.txt", []byte("Hello, MinIO!"), 0644)
    if err != nil {
        log.Fatal(err)
    }
    
    content, err := afero.ReadFile(fs, "hello.txt")
    if err != nil {
        log.Fatal(err)
    }
    
    log.Printf("Content: %s", content)
}
Method 2: Using MinIO Client
import (
    "context"
    "log"
    
    "github.com/minio/minio-go/v7"
    "github.com/minio/minio-go/v7/pkg/credentials"
    "github.com/cpyun/afero-minio"
)

func main() {
    // Create MinIO client
    client, err := minio.New("play.min.io", &minio.Options{
        Creds:  credentials.NewStaticV4("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", ""),
        Secure: true,
    })
    if err != nil {
        log.Fatal(err)
    }
    
    // Create filesystem
    fs := miniofs.NewFs(context.Background(), client, "my-bucket")
    
    // Use it
    file, err := fs.Create("test.txt")
    if err != nil {
        log.Fatal(err)
    }
    defer file.Close()
    
    _, err = file.WriteString("Hello, World!")
    if err != nil {
        log.Fatal(err)
    }
}
Append-Throughput Profile (Pure MinIO)
opts := miniofs.DefaultOptions()
opts.MaxDirectObjectSize = 8 << 20
opts.LargeObjectStrategy = miniofs.LargeObjectStrategyTempFile
opts.AppendStrategy = miniofs.AppendStrategyNative
opts.AssumeNativeAppendSupported = true
opts.StreamChunkSize = 5 << 20
opts.NativeAppendChunkSize = 5 << 20

fs, err := miniofs.NewMinioFsWithOptions(context.Background(), dsn, opts)
if err != nil {
    log.Fatal(err)
}
  • StreamChunkSize only affects MinioFile.ReadFrom, so io.Copy(file, src) now batches reads into larger writes automatically
  • With AppendStrategyNative and AssumeNativeAppendSupported=true, sequential writes at EOF prefer native append before the small-object direct rewrite branch
  • LargeObjectStrategyTempFile remains the fallback for non-sequential large writes
  • DSN-based constructors now create a dedicated append client automatically when native append is enabled, so temp-file Close/Sync uploads continue to use the normal client
  • If you build your own minio.Client, use NewFsWithClients(ctx, client, appendClient, bucket, opts) to provide a dedicated append client
  • If you only provide a single HTTP client through NewFs/NewFsWithOptions, native append is disabled automatically and the adapter falls back to compose/temp-file paths to protect Close/Sync
Advanced: Split Normal IO and Native Append Clients
baseClient, err := minio.New("10.0.5.240:9000", &minio.Options{
    Creds:  credentials.NewStaticV4("minioadmin", "minioadmin", ""),
    Secure: false,
})
if err != nil {
    log.Fatal(err)
}

appendClient, err := minio.New("10.0.5.240:9000", &minio.Options{
    Creds:           credentials.NewStaticV4("minioadmin", "minioadmin", ""),
    Secure:          false,
    TrailingHeaders: true,
})
if err != nil {
    log.Fatal(err)
}

opts := miniofs.DefaultOptions()
opts.AppendStrategy = miniofs.AppendStrategyNative
opts.AssumeNativeAppendSupported = true

fs, err := miniofs.NewFsWithClients(context.Background(), baseClient, appendClient, "my-bucket", opts)
if err != nil {
    log.Fatal(err)
}
  • Application code still uses afero.File normally: Write, io.Copy, Sync, and Close
  • In temp-file fallback mode, final persistence still happens at Sync() or Close()
  • Always check the error returned by Close(), because that is where staged writes are committed
Usage Examples
File Operations
// Create a file
file, _ := fs.Create("document.txt")
file.WriteString("content")
file.Close()

// Read a file
data, _ := afero.ReadFile(fs, "document.txt")

// Delete a file
fs.Remove("document.txt")

// Rename a file
fs.Rename("old.txt", "new.txt")

// Get file info
info, _ := fs.Stat("document.txt")
fmt.Printf("Size: %d, ModTime: %v\n", info.Size(), info.ModTime())
Directory Operations
// Create a directory
fs.Mkdir("mydir", 0755)

// Create nested directories
fs.MkdirAll("path/to/nested/dir", 0755)

// List directory contents
file, _ := fs.Open("mydir")
entries, _ := file.Readdir(-1)
for _, entry := range entries {
    fmt.Printf("%s (dir: %v)\n", entry.Name(), entry.IsDir())
}

// Remove directory and all contents
fs.RemoveAll("mydir")
Advanced Operations
// Truncate file
file, _ := fs.OpenFile("data.txt", os.O_RDWR, 0644)
file.Truncate(100)
file.Close()

// Seek in file
file, _ := fs.Open("data.txt")
file.Seek(10, io.SeekStart)
data := make([]byte, 20)
file.Read(data)
file.Close()

// Write at specific offset
file, _ := fs.OpenFile("data.txt", os.O_RDWR, 0644)
file.WriteAt([]byte("insert"), 10)
file.Close()
DSN Format

The DSN (Data Source Name) format is:

scheme://accessKey:secretKey@endpoint/bucket?param=value
  • scheme: http, https, or minio
  • accessKey: MinIO access key
  • secretKey: MinIO secret key
  • endpoint: MinIO server endpoint (e.g., play.min.io)
  • bucket: Bucket name
  • Optional parameters:
    • region: AWS region (default: us-east-1)
    • token: Session token for temporary credentials

Example:

https://Q3AM3UQ867SPQQA43P2F:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG@play.min.io/my-bucket?region=us-east-1
Implementation Details
Directory Simulation

MinIO is object storage without native directory support. This implementation simulates directories by:

  1. Creating empty objects with trailing / for explicit directories
  2. Detecting virtual directories from object key prefixes
  3. Properly handling directory listing with prefix filtering
Write Operations

Since MinIO doesn't support generic in-place object mutation:

  • Small-object writes are handled directly
  • Large append paths can use compose/native append strategies when configured
  • Large random writes can fall back to local temp-file staging or return a strategy error
Seeking
  • Seeking for reads is efficient (uses MinIO range requests)
  • Seeking for writes triggers a sync and repositions the offset
  • Multiple seeks should be avoided for best performance
Known Limitations

⚠️ Limitations inherent to MinIO:

  1. Append Depends on Strategy: O_APPEND support is configurable and native append depends on backend capabilities
  2. No Chmod/Chown: POSIX permissions are not supported (returns error)
  3. No Chtimes: Modification time is managed by MinIO (returns error)
  4. Large Random Writes: Large in-place mutation may require temp-file staging or be rejected by policy

⚠️ Performance Considerations:

  • Seeking during writes is expensive (triggers full object rewrite)
  • Partial updates are not atomic
  • Directory listings may be slow for large prefixes
API Coverage
Operation Status Notes
Create ✅ Full support
Open ✅ Full support
OpenFile ✅ Includes configurable O_APPEND support
Remove ✅ Full support
RemoveAll ✅ Deletes all objects with prefix
Rename ✅ Non-atomic copy + delete, rejects existing target
Stat ✅ Supports files, dirs, virtual dirs
Mkdir ✅ Creates empty object with / suffix
MkdirAll ✅ Creates all parent directories
Chmod ❌ Not supported by MinIO
Chown ❌ Not supported by MinIO
Chtimes ❌ Not supported by MinIO
Read/ReadAt ✅ Streaming support
Write/WriteAt ✅ Full support (may rewrite object)
Seek ✅ Optimized for reads
Truncate ✅ Full support
Readdir ✅ Lists direct children
Readdirnames ✅ Lists direct children names
Testing

Run the default unit-oriented suite:

go test -v

Run integration tests against your own MinIO instance by setting MINIOFS_TEST_DSN:

MINIOFS_TEST_DSN='minio://minioadmin:minioadmin@127.0.0.1:9000/test-bucket' go test -v
Contributing

Contributions are welcome! Please feel free to submit issues or pull requests for:

  • Bug fixes
  • Performance improvements
  • Additional test coverage
  • Documentation improvements
License

Released under the Apache 2.0 license. See LICENSE for details.

Acknowledgments

This project is inspired by and builds upon:


中文

关于

为 MinIO 对象存储提供的生产就绪的 Afero 文件系统实现。该包提供了完整的、即插即用的 afero.Fs 接口,由 MinIO 支持,可与任何使用 afero 抽象的代码无缝集成。

特性

✅ 完整实现

  • ✓ 完整的 afero.Fs 接口支持
  • ✓ 文件创建、读取、写入、删除
  • ✓ 目录操作(Mkdir、MkdirAll、ReadDir)
  • ✓ 文件操作(Rename、Truncate、Stat)
  • ✓ 流式读写
  • ✓ 优化的 Seek 支持
  • ✓ 全面的错误处理

✅ 生产就绪

  • ✓ 健壮的错误处理
  • ✓ 正确的边界条件处理
  • ✓ 使用空对象模拟目录
  • ✓ 虚拟目录检测
  • ✓ 文件句柄级的读写/Seek 锁保护

✅ 完善的测试

  • ✓ 单元测试与环境变量驱动的集成测试
  • ✓ 边界情况覆盖
  • ✓ 集成测试支持
安装
go get github.com/cpyun/afero-minio
快速开始
方法 1: 使用 DSN 字符串
import (
    "context"
    "log"
    
    "github.com/cpyun/afero-minio"
    "github.com/spf13/afero"
)

func main() {
    // DSN 格式: scheme://accessKey:secretKey@endpoint/bucket?region=us-east-1
    dsn := "https://YOUR_ACCESS_KEY:YOUR_SECRET_KEY@play.min.io/my-bucket?region=us-east-1"
    
    fs, err := miniofs.NewMinioFs(context.Background(), dsn)
    if err != nil {
        log.Fatal(err)
    }
    
    // 像使用任何 afero.Fs 一样使用它
    err = afero.WriteFile(fs, "hello.txt", []byte("你好,MinIO!"), 0644)
    if err != nil {
        log.Fatal(err)
    }
    
    content, err := afero.ReadFile(fs, "hello.txt")
    if err != nil {
        log.Fatal(err)
    }
    
    log.Printf("内容: %s", content)
}
方法 2: 使用 MinIO 客户端
import (
    "context"
    "log"
    
    "github.com/minio/minio-go/v7"
    "github.com/minio/minio-go/v7/pkg/credentials"
    "github.com/cpyun/afero-minio"
)

func main() {
    // 创建 MinIO 客户端
    client, err := minio.New("play.min.io", &minio.Options{
        Creds:  credentials.NewStaticV4("YOUR_ACCESS_KEY", "YOUR_SECRET_KEY", ""),
        Secure: true,
    })
    if err != nil {
        log.Fatal(err)
    }
    
    // 创建文件系统
    fs := miniofs.NewFs(context.Background(), client, "my-bucket")
    
    // 使用它
    file, err := fs.Create("test.txt")
    if err != nil {
        log.Fatal(err)
    }
    defer file.Close()
    
    _, err = file.WriteString("你好,世界!")
    if err != nil {
        log.Fatal(err)
    }
}
纯 MinIO 的追加吞吐型配置
opts := miniofs.DefaultOptions()
opts.MaxDirectObjectSize = 8 << 20
opts.LargeObjectStrategy = miniofs.LargeObjectStrategyTempFile
opts.AppendStrategy = miniofs.AppendStrategyNative
opts.AssumeNativeAppendSupported = true
opts.StreamChunkSize = 5 << 20
opts.NativeAppendChunkSize = 5 << 20

fs, err := miniofs.NewMinioFsWithOptions(context.Background(), dsn, opts)
if err != nil {
    log.Fatal(err)
}
  • StreamChunkSize 只影响 MinioFile.ReadFrom,所以 io.Copy(file, src) 会自动聚合成更大的写入块
  • 在 AppendStrategyNative 且 AssumeNativeAppendSupported=true 时,顺序写到 EOF 会优先走 native append,而不是先落到小对象 direct rewrite
  • 非顺序的大对象写入仍然由 LargeObjectStrategyTempFile 兜底
  • 使用 DSN 构造时,启用 native append 会自动创建专用 append client,因此 temp-file 的 Close/Sync 上传仍然走普通 client
  • 如果你自行创建 minio.Client,推荐改用 NewFsWithClients(ctx, client, appendClient, bucket, opts) 显式传入专用 append client
  • 如果你只通过 NewFs/NewFsWithOptions 传入单个 HTTP client,插件会自动关闭 native append,并安全回退到 compose/temp-file 路径,避免影响 Close/Sync
高级用法:拆分普通对象 IO 与 Native Append Client
baseClient, err := minio.New("10.0.5.240:9000", &minio.Options{
    Creds:  credentials.NewStaticV4("minioadmin", "minioadmin", ""),
    Secure: false,
})
if err != nil {
    log.Fatal(err)
}

appendClient, err := minio.New("10.0.5.240:9000", &minio.Options{
    Creds:           credentials.NewStaticV4("minioadmin", "minioadmin", ""),
    Secure:          false,
    TrailingHeaders: true,
})
if err != nil {
    log.Fatal(err)
}

opts := miniofs.DefaultOptions()
opts.AppendStrategy = miniofs.AppendStrategyNative
opts.AssumeNativeAppendSupported = true

fs, err := miniofs.NewFsWithClients(context.Background(), baseClient, appendClient, "my-bucket", opts)
if err != nil {
    log.Fatal(err)
}
  • 业务代码仍然只按 afero.File 的方式使用:Write、io.Copy、Sync、Close
  • 走 temp-file fallback 时,真正的远端提交边界仍然是 Sync() 或 Close()
  • 不要忽略 Close() 返回值,因为 staged write 的最终提交就在这里发生
使用示例

详细的使用示例请参见英文版文档。

DSN 格式

DSN(数据源名称)格式为:

scheme://accessKey:secretKey@endpoint/bucket?param=value

示例:

https://Q3AM3UQ867SPQQA43P2F:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG@play.min.io/my-bucket?region=us-east-1
已知限制

⚠️ MinIO 固有限制:

  1. 追加能力依赖策略: O_APPEND 是否可用取决于配置策略和后端能力
  2. 无 Chmod/Chown: 不支持 POSIX 权限(返回错误)
  3. 无 Chtimes: 修改时间由 MinIO 管理(返回错误)
  4. 大对象随机写有限制: 大对象就地修改可能需要本地暂存,或按策略直接拒绝
API 覆盖

完整的 API 覆盖表请参见英文版文档。

测试
go test -v

如需运行真实 MinIO 集成测试,请设置:

MINIOFS_TEST_DSN='minio://minioadmin:minioadmin@127.0.0.1:9000/test-bucket' go test -v
贡献

欢迎贡献!请随时提交问题或拉取请求。

许可证

根据 Apache 2.0 许可证发布。详见 LICENSE。

致谢

本项目受以下项目启发并基于:

Documentation

Index

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 NewMinioFs

func NewMinioFs(ctx context.Context, dsn string) (afero.Fs, error)

func NewMinioFsWithOptions

func NewMinioFsWithOptions(ctx context.Context, dsn string, opts Options) (afero.Fs, error)

func NewPathError

func NewPathError(op, path string, err error) error

NewPathError creates a new PathError

func ParseURL

func ParseURL(minioURL string) (*minio.Options, error)

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

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j

func (ByName) Swap

func (a ByName) Swap(i, j int)

Swap exchanges the elements with indexes i and j

type FileInfo

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

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() interface{}

type Fs

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

func NewFs

func NewFs(ctx context.Context, client *minio.Client, bucket string) *Fs

func NewFsWithClients

func NewFsWithClients(ctx context.Context, client *minio.Client, appendClient *minio.Client, bucket string, opts Options) (*Fs, error)

func NewFsWithOptions

func NewFsWithOptions(ctx context.Context, client *minio.Client, bucket string, opts Options) (*Fs, error)

func (*Fs) Chmod

func (fs *Fs) Chmod(_ string, _ os.FileMode) error

func (*Fs) Chown

func (fs *Fs) Chown(_ string, _, _ int) error

func (*Fs) Chtimes

func (fs *Fs) Chtimes(_ string, _, _ time.Time) error

func (*Fs) Create

func (fs *Fs) Create(name string) (afero.File, error)

func (*Fs) Mkdir

func (fs *Fs) Mkdir(name string, _ os.FileMode) error

func (*Fs) MkdirAll

func (fs *Fs) MkdirAll(name string, _ os.FileMode) error

func (*Fs) Name

func (fs *Fs) Name() string

func (*Fs) Open

func (fs *Fs) Open(name string) (afero.File, error)

func (*Fs) OpenFile

func (fs *Fs) OpenFile(name string, flag int, fileMode os.FileMode) (afero.File, error)

func (*Fs) Remove

func (fs *Fs) Remove(name string) error

func (*Fs) RemoveAll

func (fs *Fs) RemoveAll(pathName string) error

func (*Fs) Rename

func (fs *Fs) Rename(oldName, newName string) error

func (*Fs) Stat

func (fs *Fs) Stat(name string) (os.FileInfo, error)

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

func NewMinioFile(ctx context.Context, fs *Fs, openFlags int, fileMode os.FileMode, name string, initialInfo ...os.FileInfo) *MinioFile

func (*MinioFile) Close

func (o *MinioFile) Close() error

func (*MinioFile) Name

func (o *MinioFile) Name() string

func (*MinioFile) Read

func (o *MinioFile) Read(p []byte) (int, error)

func (*MinioFile) ReadAt

func (o *MinioFile) ReadAt(p []byte, off int64) (int, error)

func (*MinioFile) ReadFrom

func (o *MinioFile) ReadFrom(src io.Reader) (int64, error)

func (*MinioFile) Readdir

func (o *MinioFile) Readdir(count int) ([]os.FileInfo, error)

func (*MinioFile) Readdirnames

func (o *MinioFile) Readdirnames(n int) ([]string, error)

func (*MinioFile) Seek

func (o *MinioFile) Seek(offset int64, whence int) (int64, error)

func (*MinioFile) Stat

func (o *MinioFile) Stat() (os.FileInfo, error)

func (*MinioFile) Sync

func (o *MinioFile) Sync() error

func (*MinioFile) Truncate

func (o *MinioFile) Truncate(size int64) error

func (*MinioFile) Write

func (o *MinioFile) Write(p []byte) (int, error)

func (*MinioFile) WriteAt

func (o *MinioFile) WriteAt(p []byte, off int64) (int, error)

func (*MinioFile) WriteString

func (o *MinioFile) WriteString(s string) (int, error)

func (*MinioFile) WriteTo

func (o *MinioFile) WriteTo(dst io.Writer) (int64, error)

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 PathError

type PathError = os.PathError

type WriteStrategy

type WriteStrategy string
const (
	WriteStrategyDirect  WriteStrategy = "direct"
	WriteStrategyStaging WriteStrategy = "staging"
)

Jump to

Keyboard shortcuts

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