fs

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvVar

func GetEnvVar(path string) string

func GetFilePathFromServerPath

func GetFilePathFromServerPath(pathname string) string

func ResolveHomeDir

func ResolveHomeDir(path string) string

Types

type Environment

type Environment struct {
	FS FS
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(fs FS, getEnv func(string) string) *Environment

type FS

type FS interface {
	fs.FS

	Write(path string, data []byte) error
}

func CreateFileSystem

func CreateFileSystem(root string) FS

func CreateMemoryFileSystem

func CreateMemoryFileSystem() FS

func CreateS3

func CreateS3(bucket string, client *s3.Client) FS

func TryCreateS3

func TryCreateS3(bucket string, region string) (FS, error)

type LocalFS

type LocalFS struct {
	iofs.FS
	// contains filtered or unexported fields
}

func (*LocalFS) Write

func (fs *LocalFS) Write(path string, data []byte) error

type Lookup

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

func CreateFileSystemLookup

func CreateFileSystemLookup(root string) *Lookup

func CreateLookup

func CreateLookup(root FS) *Lookup

func (*Lookup) Get

func (lookup *Lookup) Get(pathname string) (fs.File, error)

func (*Lookup) Write

func (lookup *Lookup) Write(path string, data []byte) error

type MemFile

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

func (*MemFile) Close

func (f *MemFile) Close() error

func (*MemFile) Read

func (f *MemFile) Read(b []byte) (int, error)

func (*MemFile) Stat

func (f *MemFile) Stat() (iofs.FileInfo, error)

type MemFile2

type MemFile2 interface {
	Stat() (iofs.FileInfo, error)
	Read([]byte) (int, error)
	Close() error
}

type MemFileInfo

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

func (MemFileInfo) IsDir

func (fi MemFileInfo) IsDir() bool

func (MemFileInfo) ModTime

func (fi MemFileInfo) ModTime() time.Time

func (MemFileInfo) Mode

func (fi MemFileInfo) Mode() iofs.FileMode

func (MemFileInfo) Name

func (fi MemFileInfo) Name() string

func (MemFileInfo) Size

func (fi MemFileInfo) Size() int64

func (MemFileInfo) Sys

func (fi MemFileInfo) Sys() any

type MemoryFS

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

func CreateMemoryFS

func CreateMemoryFS() *MemoryFS

func (*MemoryFS) Open

func (mem *MemoryFS) Open(name string) (iofs.File, error)

type MemoryFileSystem

type MemoryFileSystem struct {
	*MemoryFS
}

func (*MemoryFileSystem) Write

func (mem *MemoryFileSystem) Write(path string, data []byte) error

type S3FS

type S3FS struct {
	iofs.FS
	// contains filtered or unexported fields
}

func (*S3FS) Write

func (fs *S3FS) Write(key string, data []byte) error

type UnderlyingEnvValue

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

func NewUnderlyingEnvValue

func NewUnderlyingEnvValue(key string) *UnderlyingEnvValue

func (*UnderlyingEnvValue) Get

func (u *UnderlyingEnvValue) Get(env *Environment) ([]byte, error)

type UnderlyingFileValue

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

func NewUnderlyingFileValue

func NewUnderlyingFileValue(path string) *UnderlyingFileValue

func (*UnderlyingFileValue) Get

func (u *UnderlyingFileValue) Get(env *Environment) ([]byte, error)

type UnderlyingValue

type UnderlyingValue interface {
	Get(env *Environment) ([]byte, error)
}

Jump to

Keyboard shortcuts

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