httpmirror

package module
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 12 Imported by: 0

README

httpmirror

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotOK = fmt.Errorf("http status not ok")

Functions

This section is empty.

Types

type FS

type FS interface {
	List(ctx context.Context, p string, fn func(fs.FileInfo) error) error
	Stat(ctx context.Context, p string) (fs.FileInfo, error)
	Get(ctx context.Context, p string) (f io.ReadCloser, err error)
	Put(ctx context.Context, p string, f io.Reader) (err error)
	Del(ctx context.Context, p string) error
}

type Logger

type Logger interface {
	Println(v ...interface{})
}

type MirrorHandler

type MirrorHandler struct {
	// RemoteCache is the cache of the remote file system
	RemoteCache FS
	// RedirectLinks is the redirect link
	RedirectLinks func(p string) (string, bool)
	// BaseDomain is the domain name suffix
	BaseDomain string
	// Client is used without the connect method
	Client *http.Client
	// ProxyDial specifies the optional proxyDial function for
	// establishing the transport connection.
	ProxyDial func(context.Context, string, string) (net.Conn, error)
	// NotFound Not proxy requests
	NotFound http.Handler
	// Logger error log
	Logger Logger
	// CheckSyncTimeout is the timeout for checking the sync
	CheckSyncTimeout time.Duration
	// HostFromFirstPath is the host from the first path
	HostFromFirstPath bool

	// BlockSuffix is for block some source
	BlockSuffix []string
	// contains filtered or unexported fields
}

MirrorHandler mirror handler

func (*MirrorHandler) ServeHTTP

func (m *MirrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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