filesystem

package
v0.0.0-...-8411d4f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RootDir  string
	Endpoint *oss.Endpoint
}

type FileSystem

type FileSystem struct {
	Base     string
	Endpoint oss.Endpoint
}

FileSystem file system storage

func New

func New(cfg *Config) *FileSystem

New initialize FileSystem storage

func (*FileSystem) AssetFS

func (this *FileSystem) AssetFS() (_ assetfs.Interface, err error)

func (FileSystem) Delete

func (this FileSystem) Delete(path string) error

Delete delete file

func (*FileSystem) Get

func (this *FileSystem) Get(path string) (*os.File, error)

Get receive file with given path

func (*FileSystem) GetDynamicURL

func (this *FileSystem) GetDynamicURL(scheme, host string, p ...string) (url string)

func (*FileSystem) GetEndpoint

func (this *FileSystem) GetEndpoint() *oss.Endpoint

GetEndpoint get Endpoint, FileSystem's Endpoint is /

func (*FileSystem) GetFullPath

func (this *FileSystem) GetFullPath(path string) string

GetFullPath get full path from absolute/relative path

func (*FileSystem) GetURL

func (this *FileSystem) GetURL(p ...string) (url string)

func (*FileSystem) List

func (this *FileSystem) List(path string) ([]*oss.Object, error)

List list all objects under current path

func (*FileSystem) Put

func (this *FileSystem) Put(path string, reader io.Reader) (*oss.Object, error)

Put store a reader into given path

func (*FileSystem) ServeHTTP

func (this *FileSystem) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*FileSystem) Stat

func (this *FileSystem) Stat(path string) (info os.FileInfo, notFound bool, err error)

Jump to

Keyboard shortcuts

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