s3fs

package
v0.0.0-...-e5f5cd0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Implements a 9p file system that talks to Amazon's S3 Object Storage Service.

Also supports any S3-compatible service as well.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUseMkDirToCreateBucket = errors.New("create a directory to create a bucket")
	ErrMustOpenForReading     = errors.New("must open for reading results")
)

Functions

func New

func New(endpoint string, opt Options) ninep.FileSystem

New returns a reasonable default configuration of an S3 FileSystem, an empty string of endpoint defaults to AWS' S3 service.

Parameters:

  • endpoint defaults to AWS' S3 service if it is an empty string.
  • opt contains options for configuring the Filesystem

func NewWithAwsConfig

func NewWithAwsConfig(cfg aws.Config, opt Options) ninep.FileSystem

NewWithAwsConfig returns a s3 FileSystem from a given s3 aws.Config object.

Parameters:

  • cfg is the aws.Config used to configure the s3 client.
  • opt contains options for configuring the Filesystem

func NewWithClient

func NewWithClient(s3c *S3Ctx, opt Options) ninep.FileSystem

NewWithClient returns a s3 FileSystem from a given s3 client and session.

Parameters:

  • s3c is the configured s3 client and session. Both fields are required.
  • opt contains options for configuring the Filesystem

Types

type Options

type Options struct {
	Endpoint string
	//  Flatten makes listing an object key prefix returns the full keys instead of
	//  just the logical directory names. This can be more efficient to use S3
	//  API at the cost of breaking some of the file system abstraction layer.
	Flatten bool

	S3PathStyle bool
	// Logger to use. Default
	Logger *slog.Logger
}

type S3Ctx

type S3Ctx struct {
	Client *s3.Client
}

Jump to

Keyboard shortcuts

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