s3proxy

package
v0.0.0-...-ccf9024 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const CHUNK_SIZE = 1024 * 1024 * 1024

Variables

This section is empty.

Functions

func NewS3Fs

func NewS3Fs(bucketOpts map[string]BucketOpts) http.FileSystem

func RunWebServer

func RunWebServer(opts *S3ProxyOpts)

Types

type BindAddress

type BindAddress struct {
	Host    string // Either host name or an IP address (IPv4 or IPv6)
	Port    int
	IsHttps bool
}

type BucketOpts

type BucketOpts struct {
	Bucket string // Bucket name, if not specified, it's the same as the key
	Region string // AWS region
	Key    string // AWS key
	Secret string // AWS secret
}

type HttpsOpts

type HttpsOpts struct {
	Cert string // Certificate file (mandatory)
	Key  string // Key file (mandatory)
}

type Listing

type Listing struct {
	BucketName string
	MountName  string
	Objects    []ListingItem
}

type ListingItem

type ListingItem struct {
	Key          string
	LastModified time.Time
}

type S3Chunk

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

type S3File

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

func NewS3File

func NewS3File(cl *s3.S3, bucket, key string) (*S3File, error)

func (*S3File) Close

func (f *S3File) Close() error

func (*S3File) IsDir

func (f *S3File) IsDir() bool

func (*S3File) ModTime

func (f *S3File) ModTime() time.Time

func (*S3File) Mode

func (f *S3File) Mode() os.FileMode

func (*S3File) Name

func (f *S3File) Name() string

func (*S3File) Read

func (f *S3File) Read(p []byte) (n int, err error)

func (*S3File) Readdir

func (f *S3File) Readdir(count int) ([]os.FileInfo, error)

func (*S3File) Seek

func (f *S3File) Seek(offset int64, whence int) (int64, error)

func (*S3File) Size

func (f *S3File) Size() int64

func (*S3File) Stat

func (f *S3File) Stat() (os.FileInfo, error)

func (*S3File) Sys

func (f *S3File) Sys() interface{}

type S3Fs

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

func (S3Fs) Open

func (fs S3Fs) Open(filePath string) (http.File, error)

type S3ProxyOpts

type S3ProxyOpts struct {
	Web     WebOpts               // Web server configuration
	Buckets map[string]BucketOpts // Bucket configuration
}

func NewS3ProxyOpts

func NewS3ProxyOpts() (opts *S3ProxyOpts)

Create a S3ProxyOpts object with default settings filled in

func (*S3ProxyOpts) LoadYaml

func (opts *S3ProxyOpts) LoadYaml(fileName string) error

Load the configuration data from a Yaml file

type WebOpts

type WebOpts struct {
	BindAddresses []BindAddress // List of addresses the server should bind to
	Https         HttpsOpts     // Https configuration
	EnableAuth    bool          // Enable basic HTTP auth
	HtpasswdFile  string        // path to the htpasswd file
}

Jump to

Keyboard shortcuts

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