server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(fs afero.Fs) func(w http.ResponseWriter, r *http.Request)

func New

func New(fs afero.Fs) proxy.Filesystem

Types

type Config

type Config struct {
	KeyId     string `flag:"keyid,Access Key ID" reg:"KeyID" json:"keyid"`
	KeySecret string `flag:"secret,Access Key Secret" reg:"KeySecret" json:"secret"`
	Directory string `flag:"directory,Directory to serve" reg:"Directory" json:"directory"`
	Pattern   string `flag:"pattern,HTTP path pattern" reg:"Pattern" json:"pattern"`
}

func (*Config) ToHandler

func (c *Config) ToHandler() (string, http.HandlerFunc, error)

func (*Config) Validate

func (c *Config) Validate() error

type FilesystemServer

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

func (*FilesystemServer) Chmod

func (fs *FilesystemServer) Chmod(ctx context.Context, name string, mode proxy.FileMode) error

func (*FilesystemServer) Chown

func (fs *FilesystemServer) Chown(ctx context.Context, name string, uid int32, gid int32) (_err error)

func (*FilesystemServer) Chtimes

func (fs *FilesystemServer) Chtimes(ctx context.Context, name string, atime proxy.Timestamp, mtime proxy.Timestamp) (_err error)

func (*FilesystemServer) Create

func (fs *FilesystemServer) Create(ctx context.Context, name string) (_r proxy.FileHandle, _err error)

func (*FilesystemServer) Fclose

func (fs *FilesystemServer) Fclose(ctx context.Context, file proxy.FileHandle) (_err error)

func (*FilesystemServer) Fname

func (fs *FilesystemServer) Fname(ctx context.Context, file proxy.FileHandle) (_r string, _err error)

func (*FilesystemServer) Fread

func (fs *FilesystemServer) Fread(ctx context.Context, file proxy.FileHandle, bufferSize int64) (_r []byte, _err error)

func (*FilesystemServer) FreadAt

func (fs *FilesystemServer) FreadAt(ctx context.Context, file proxy.FileHandle, bufferSize int64, offset int64) (_r []byte, _err error)

func (*FilesystemServer) Freaddir

func (fs *FilesystemServer) Freaddir(ctx context.Context, file proxy.FileHandle, count int32) (_r []*proxy.FileInfo, _err error)

Freaddir implements proxy.Filesystem.

func (*FilesystemServer) Freaddirnames

func (fs *FilesystemServer) Freaddirnames(ctx context.Context, file proxy.FileHandle, count int32) (_r []string, _err error)

func (*FilesystemServer) Fseek

func (fs *FilesystemServer) Fseek(ctx context.Context, file proxy.FileHandle, offset int64, whence int32) (_r int64, _err error)

func (*FilesystemServer) Fstat

func (fs *FilesystemServer) Fstat(ctx context.Context, file proxy.FileHandle) (_r *proxy.FileInfo, _err error)

func (*FilesystemServer) Fsync

func (fs *FilesystemServer) Fsync(ctx context.Context, file proxy.FileHandle) (_err error)

func (*FilesystemServer) Ftruncate

func (fs *FilesystemServer) Ftruncate(ctx context.Context, file proxy.FileHandle, size int64) (_err error)

func (*FilesystemServer) Fwrite

func (fs *FilesystemServer) Fwrite(ctx context.Context, file proxy.FileHandle, buffer []byte) (_r int32, _err error)

func (*FilesystemServer) FwriteAt

func (fs *FilesystemServer) FwriteAt(ctx context.Context, file proxy.FileHandle, buffer []byte, offset int64) (_r int32, _err error)

func (*FilesystemServer) FwriteString

func (fs *FilesystemServer) FwriteString(ctx context.Context, file proxy.FileHandle, value string) (_r int32, _err error)

func (*FilesystemServer) Mkdir

func (fs *FilesystemServer) Mkdir(ctx context.Context, path string, perm proxy.FileMode) (_err error)

func (*FilesystemServer) MkdirAll

func (fs *FilesystemServer) MkdirAll(ctx context.Context, path string, perm proxy.FileMode) (_err error)

func (*FilesystemServer) Name

func (fs *FilesystemServer) Name(ctx context.Context) (_r string, _err error)

func (*FilesystemServer) Open

func (fs *FilesystemServer) Open(ctx context.Context, name string) (_r proxy.FileHandle, _err error)

func (*FilesystemServer) OpenFile

func (fs *FilesystemServer) OpenFile(ctx context.Context, name string, flag int32, perm proxy.FileMode) (_r proxy.FileHandle, _err error)

func (*FilesystemServer) Remove

func (fs *FilesystemServer) Remove(ctx context.Context, name string) (_err error)

func (*FilesystemServer) RemoveAll

func (fs *FilesystemServer) RemoveAll(ctx context.Context, name string) (_err error)

func (*FilesystemServer) Rename

func (fs *FilesystemServer) Rename(ctx context.Context, oldname string, newname string) (_err error)

func (*FilesystemServer) Stat

func (fs *FilesystemServer) Stat(ctx context.Context, name string) (_r *proxy.FileInfo, _err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳