fsadapter

package
v0.0.0-...-0e01d27 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fsadapter provides file-engine components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicWriteFile

func AtomicWriteFile(fullPath string, perm os.FileMode, r io.Reader) error

func SafeJoin

func SafeJoin(base string, parts ...string) (string, error)

Types

type FileSystem

type FileSystem interface {
	CreateFolder(ctx context.Context, parts ...string) error
	AtomicWriteFile(ctx context.Context, perm uint32, data []byte, parts ...string) error
	MoveUploadedFile(ctx context.Context, src, dst []string) error
	Exists(parts ...string) (bool, error)
}

FileSystem defines the filesystem operations required by task processing. Implementations belong to adapter packages such as local or sftp.

type SftpFs

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

SftpFs is an adapter implementation backed by an SFTP remote filesystem.

func NewSftpFs

func NewSftpFs(addr, user, password string, privateKey []byte, baseRoot string) (*SftpFs, error)

func (*SftpFs) AtomicWriteFile

func (s *SftpFs) AtomicWriteFile(_ context.Context, perm uint32, data []byte, parts ...string) error

func (*SftpFs) Close

func (s *SftpFs) Close()

func (*SftpFs) CreateFolder

func (s *SftpFs) CreateFolder(_ context.Context, parts ...string) error

func (*SftpFs) Exists

func (s *SftpFs) Exists(parts ...string) (bool, error)

func (*SftpFs) MoveUploadedFile

func (s *SftpFs) MoveUploadedFile(_ context.Context, src, dst []string) error

Directories

Path Synopsis
Package local provides file-engine components.
Package local provides file-engine components.

Jump to

Keyboard shortcuts

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