s3

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 29 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.

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 proxyflags.Opt.AuthProxy == "" {
			cmd.CheckArgs(1, 1, command, args)
			f = cmd.NewFsSrc(args)
		} else {
			cmd.CheckArgs(0, 0, command, args)
		}

		if Opt.hashName == "auto" {
			Opt.hashType = f.Hashes().GetOne()
		} else if Opt.hashName != "" {
			err := Opt.hashType.Set(Opt.hashName)
			if err != nil {
				return err
			}
		}
		cmd.Run(false, false, command, func() error {
			s, err := newServer(context.Background(), f, &Opt)
			if err != nil {
				return err
			}
			router := s.server.Router()
			s.Bind(router)
			err = s.Serve()
			if err != nil {
				return err
			}
			s.server.Wait()
			return nil
		})
		return nil
	},
}

Command definition for cobra

View Source
var DefaultOpt = Options{

	Auth: httplib.DefaultAuthCfg(),
	HTTP: httplib.DefaultCfg(),
	// contains filtered or unexported fields
}

DefaultOpt is the default values used for Options

Opt is options set by command line flags

Functions

This section is empty.

Types

type Options

type Options struct {
	Auth httplib.AuthConfig
	HTTP httplib.Config
	// contains filtered or unexported fields
}

Options contains options for the http Server

type Server

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

Server is a s3.FileSystem interface

func (*Server) Bind

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

Bind register the handler to http.Router

func (*Server) Serve

func (w *Server) Serve() error

Serve serves the s3 server

Jump to

Keyboard shortcuts

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