fs

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGCSFS

func NewGCSFS(ctx context.Context, bucket string, client *gcs.Client) *gcsFS

func NewLocalFS

func NewLocalFS(base string) *localFS

func NewS3FS

func NewS3FS(ctx context.Context, bucket string, cfg aws.Config) *s3FS

func NewSFTPFS

func NewSFTPFS(host, user, password string) (*sshFS, error)

func NewSMBFS

func NewSMBFS(server string, port, share string, auth types.Authentication) (*smbFS, error)

Types

type FileInfo

type FileInfo interface {
	os.FileInfo
	FullPath() string
}

FileInfo is a wrapper for os.FileInfo that also returns the full path of the file.

FullPath is required to support globs with ReadDir()

type Filesystem

type Filesystem interface {
	Close() error
	ReadDir(name string) ([]FileInfo, error)
	Stat(name string) (os.FileInfo, error)
}

type FilesystemRW

type FilesystemRW interface {
	Filesystem
	Read(ctx context.Context, path string) (io.ReadCloser, error)
	Write(ctx context.Context, path string, data io.Reader) (os.FileInfo, error)
}

type GCSFileInfo

type GCSFileInfo struct {
	Object *gcs.ObjectAttrs
}

GCSFileInfo wraps GCS object attributes to implement os.FileInfo and FileInfo

func (GCSFileInfo) FullPath

func (obj GCSFileInfo) FullPath() string

func (GCSFileInfo) IsDir

func (GCSFileInfo) IsDir() bool

func (GCSFileInfo) ModTime

func (obj GCSFileInfo) ModTime() time.Time

func (GCSFileInfo) Mode

func (obj GCSFileInfo) Mode() fs.FileMode

func (GCSFileInfo) Name

func (obj GCSFileInfo) Name() string

func (GCSFileInfo) Size

func (obj GCSFileInfo) Size() int64

func (GCSFileInfo) Sys

func (obj GCSFileInfo) Sys() interface{}

type ListItemLimiter

type ListItemLimiter interface {
	SetMaxListItems(maxList int)
}

type S3FileInfo

type S3FileInfo struct {
	Object s3Types.Object
}

S3FileInfo wraps S3 object metadata to implement os.FileInfo and FileInfo

func (S3FileInfo) FullPath

func (obj S3FileInfo) FullPath() string

func (S3FileInfo) IsDir

func (obj S3FileInfo) IsDir() bool

func (S3FileInfo) ModTime

func (obj S3FileInfo) ModTime() time.Time

func (S3FileInfo) Mode

func (obj S3FileInfo) Mode() fs.FileMode

func (S3FileInfo) Name

func (obj S3FileInfo) Name() string

func (S3FileInfo) Size

func (obj S3FileInfo) Size() int64

func (S3FileInfo) Sys

func (obj S3FileInfo) Sys() interface{}

type SMBFileInfo

type SMBFileInfo struct {
	Base string
	fs.FileInfo
}

func (*SMBFileInfo) FullPath

func (t *SMBFileInfo) FullPath() string

type SMBSession

type SMBSession struct {
	net.Conn
	*smb2.Session
	*smb2.Share
}

SMBSession holds SMB connection details

func (*SMBSession) Close

func (s *SMBSession) Close() error

Jump to

Keyboard shortcuts

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