unionfs

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT, MIT Imports: 6 Imported by: 0

README

unionfs

Go lang union http.FileSystem

Installation

$ go get github.com/dolfly/httpfs/unionfs

Usage

import "github.com/dolfly/httpfs/unionfs"

Examples

UnionFS
package main

import (
	"github.com/dolfly/httpfs/unionfs"
	"net/http"
)

func main() {
	fs := unionfs.New(http.Dir("A"), http.Dir("B"))

	http.Handle("/", http.FileServer(fs))
	http.ListenAndServe(":8080", nil)
}

Simple union file system webserver

Author

gnue

License

MIT

Documentation

Overview

Go lang union http.FileSystem

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dinfo

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

func (*Dinfo) Open

func (d *Dinfo) Open() (http.File, error)

type Dir

type Dir struct {
	*Dinfo
	// contains filtered or unexported fields
}

func (*Dir) Close

func (d *Dir) Close() error

func (*Dir) Read

func (d *Dir) Read(p []byte) (int, error)

func (*Dir) Readdir

func (d *Dir) Readdir(count int) (finfos []os.FileInfo, err error)

func (*Dir) Seek

func (d *Dir) Seek(offset int64, whence int) (int64, error)

func (*Dir) Stat

func (d *Dir) Stat() (os.FileInfo, error)

type DirInfo

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

func (*DirInfo) IsDir

func (f *DirInfo) IsDir() bool

func (*DirInfo) ModTime

func (f *DirInfo) ModTime() time.Time

func (*DirInfo) Mode

func (f *DirInfo) Mode() os.FileMode

func (*DirInfo) Name

func (f *DirInfo) Name() string

func (*DirInfo) Size

func (f *DirInfo) Size() int64

func (*DirInfo) Sys

func (f *DirInfo) Sys() interface{}

type FileSystem

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

func New

func New(fileSystems ...http.FileSystem) *FileSystem

func (*FileSystem) Open

func (u *FileSystem) Open(name string) (http.File, error)

Jump to

Keyboard shortcuts

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