s3

package
v1.66.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 23 Imported by: 0

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:  serveS3Help + httplib.Help(flagPrefix) + vfs.Help,
	RunE: func(command *cobra.Command, args []string) error {
		cmd.CheckArgs(1, 1, command, args)
		f := cmd.NewFsSrc(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.Router()
			s.Bind(router)
			err = s.serve()
			if err != nil {
				return err
			}
			s.Wait()
			return nil
		})
		return nil
	},
}

Command definition for cobra

View Source
var DefaultOpt = Options{

	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 {
	HTTP httplib.Config
	// contains filtered or unexported fields
}

Options contains options for the http Server

type Server

type Server struct {
	*httplib.Server
	// 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

Jump to

Keyboard shortcuts

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