fileio

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinIfFirstNotEmpty

func JoinIfFirstNotEmpty(elem ...string) string

Types

type SearcherFile

type SearcherFile []http.File

func (SearcherFile) Close

func (sf SearcherFile) Close() error

Close implements the http.File interface

func (SearcherFile) Read

func (sf SearcherFile) Read(p []byte) (n int, err error)

Read implements the http.File interface

func (SearcherFile) Readdir

func (sf SearcherFile) Readdir(count int) (infos []fs.FileInfo, err error)

Readdir implements the http.File interface

func (SearcherFile) Seek

func (sf SearcherFile) Seek(offset int64, whence int) (i int64, e error)

Seek implements the http.File interface

func (SearcherFile) Stat

func (sf SearcherFile) Stat() (i fs.FileInfo, e error)

Stat implements the http.File interface

type SearcherFilesystem

type SearcherFilesystem []http.FileSystem

SearcherFilesystem is a http.Filesystem that looks through multiple http. Filesystems for a file returning the first one found

func NewLocalAndOtherSearcherFilesystem

func NewLocalAndOtherSearcherFilesystem(basePath string, other ...http.FileSystem) SearcherFilesystem

NewLocalAndOtherSearcherFilesystem creates a SearcherFilesystem from a local basePath ( if not empty) and other http.FileSystems. The local fs will be the first one.

func (SearcherFilesystem) Open

func (lfs SearcherFilesystem) Open(name string) (http.File, error)

Open implements the http.FileSystem interface

Jump to

Keyboard shortcuts

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