s3

package
v1.70.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 35 Imported by: 4

Documentation

Overview

Package s3 implements an s3 server for rclone

Package s3 implements a fake s3 server for rclone

Package s3 implements a fake s3 server for rclone

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Annotations: map[string]string{
		"versionIntroduced": "v1.65",
		"groups":            "Filter",
		"status":            "Experimental",
	},
	Use:   "s3 remote:path",
	Short: `Serve remote:path over s3.`,
	Long:  help() + httplib.AuthHelp(flagPrefix) + httplib.Help(flagPrefix) + vfs.Help(),
	RunE: func(command *cobra.Command, args []string) error {
		var f fs.Fs
		if proxy.Opt.AuthProxy == "" {
			cmd.CheckArgs(1, 1, command, args)
			f = cmd.NewFsSrc(args)
		} else {
			cmd.CheckArgs(0, 0, command, args)
		}

		cmd.Run(false, false, command, func() error {
			s, err := newServer(context.Background(), f, &Opt, &vfscommon.Opt, &proxy.Opt)
			if err != nil {
				return err
			}
			return s.Serve()
		})
		return nil
	},
}

Command definition for cobra

View Source
var OptionsInfo = fs.Options{{
	Name:    "force_path_style",
	Default: true,
	Help:    "If true use path style access if false use virtual hosted style",
}, {
	Name:    "etag_hash",
	Default: "MD5",
	Help:    "Which hash to use for the ETag, or auto or blank for off",
}, {
	Name:    "auth_key",
	Default: []string{},
	Help:    "Set key pair for v4 authorization: access_key_id,secret_access_key",
}, {
	Name:    "no_cleanup",
	Default: false,
	Help:    "Not to cleanup empty folder after object is deleted",
}}.
	Add(httplib.ConfigInfo).
	Add(httplib.AuthConfigInfo)

OptionsInfo describes the Options in use

Functions

This section is empty.

Types

type Options

type Options struct {
	//TODO add more options
	ForcePathStyle bool     `config:"force_path_style"`
	EtagHash       string   `config:"etag_hash"`
	AuthKey        []string `config:"auth_key"`
	NoCleanup      bool     `config:"no_cleanup"`
	Auth           httplib.AuthConfig
	HTTP           httplib.Config
}

Options contains options for the s3 Server

var Opt Options

Opt is options set by command line flags

type Server

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

Server is a s3.FileSystem interface

func (*Server) Addr added in v1.70.0

func (w *Server) Addr() net.Addr

Addr returns the first address of the server

func (*Server) Bind

func (w *Server) Bind(router chi.Router)

Bind register the handler to http.Router

func (*Server) Serve added in v1.68.0

func (w *Server) Serve() error

Serve serves the s3 server until the server is shutdown

func (*Server) Shutdown added in v1.70.0

func (w *Server) Shutdown() error

Shutdown the server

Jump to

Keyboard shortcuts

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