porting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

package porting deals with importing and exporting to and from gotfs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB stores metadata about the state of the directory and any data that has been imported from it.

func NewDB

func NewDB(conn *sqlutil.Conn, paramHash [32]byte) *DB

func (*DB) Delete

func (db *DB) Delete(ctx context.Context, p string) error

Delete removes all information associated with a path.

func (*DB) GetFSRoot

func (db *DB) GetFSRoot(ctx context.Context, p string, dst *gotfs.Root) (bool, error)

func (*DB) GetInfo

func (db *DB) GetInfo(ctx context.Context, p string, dst *FileInfo) (bool, error)

func (*DB) PutFSRoot

func (db *DB) PutFSRoot(ctx context.Context, p string, modt tai64.TAI64N, fsroot gotfs.Root) error

func (*DB) PutInfo

func (db *DB) PutInfo(ctx context.Context, ent FileInfo) error

type ErrWouldClobber

type ErrWouldClobber struct {
	Op   string
	Path string
}

func (ErrWouldClobber) Error

func (e ErrWouldClobber) Error() string

type Exporter

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

func NewExporter

func NewExporter(gotfs *gotfs.Machine, db *DB, fsx posixfs.FS, filter func(p string) bool) *Exporter

func (*Exporter) Clobber

func (pr *Exporter) Clobber(ctx context.Context, ms, ds stores.Reading, root gotfs.Root, p string) error

func (*Exporter) ExportFile

func (pr *Exporter) ExportFile(ctx context.Context, ms, ds stores.Reading, root gotfs.Root, p string) error

func (*Exporter) ExportPath

func (pr *Exporter) ExportPath(ctx context.Context, ms, ds stores.Reading, root gotfs.Root, p string) error

ExportPaths checks what is at p in root, and then exports the directory or file to the filesystem.

type FileInfo

type FileInfo struct {
	Path       string
	ModifiedAt tai64.TAI64N
	Mode       fs.FileMode
	Size       int64
}

type Importer

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

func NewImporter

func NewImporter(fsmach *gotfs.Machine, db *DB, ss [2]stores.RW) *Importer

func (*Importer) ImportFile

func (pr *Importer) ImportFile(ctx context.Context, fsx posixfs.FS, p string) (*gotfs.Root, error)

func (*Importer) ImportPath

func (pr *Importer) ImportPath(ctx context.Context, fsx posixfs.FS, p string) (*gotfs.Root, error)

ImportPath returns gotfs instance containing the content in fsx at p. The content will be at the root of the filesystem.

type Span

type Span struct {
	Begin string
	End   string
}

Span is a span of paths

func (Span) Contains

func (s Span) Contains(x string) bool

func (Span) IsPrefix

func (s Span) IsPrefix() bool

func (Span) String

func (s Span) String() string

Jump to

Keyboard shortcuts

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