fd

package
v0.0.0-...-3525705 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateUnknown = state(iota)
	StateFileInfo
	StateRead
	StateStored
)

Variables

This section is empty.

Functions

func Base

func Base(p string) string

func Dir

func Dir(p string) string

func DirBaseOnly

func DirBaseOnly(p string) string

func DoesDirectoryContainPath

func DoesDirectoryContainPath(dir, path string) bool

func Ext

func Ext(p string) string

func ExtSansDot

func ExtSansDot(p string) string

func FileNameSansExt

func FileNameSansExt(p string) string

func FileNameSansExtRelTo

func FileNameSansExtRelTo(p, d string) (string, error)

func FsRootDir

func FsRootDir() string

func ZettelId

func ZettelId(p string) string

Types

type FD

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

func MakeFromDirPath

func MakeFromDirPath(
	path string,
) (fd *FD, err error)

func MakeFromFileInfoWithDir

func MakeFromFileInfoWithDir(
	fileInfo os.FileInfo,
	dir string,
	blobStore interfaces.BlobWriterFactory,
) (fd *FD, err error)

func MakeFromPath

func MakeFromPath(
	baseDir string,
	path string,
	blobWriter interfaces.BlobWriterFactory,
) (fd *FD, err error)

func MakeFromPathAndDirEntry

func MakeFromPathAndDirEntry(
	path string,
	dirEntry fs.DirEntry,
	blobWriter interfaces.BlobWriterFactory,
) (fd *FD, err error)

func (*FD) Clone

func (fd *FD) Clone() (dst *FD)

func (*FD) DepthRelativeTo

func (fd *FD) DepthRelativeTo(dir string) int

func (*FD) DirBaseOnly

func (fd *FD) DirBaseOnly() string

func (*FD) Equals

func (fd *FD) Equals(b *FD) bool

func (*FD) Equals2

func (fd *FD) Equals2(b *FD) (bool, string)

func (*FD) Exists

func (fd *FD) Exists() bool

func (*FD) Ext

func (fd *FD) Ext() string

func (*FD) ExtSansDot

func (fd *FD) ExtSansDot() string

func (*FD) FileName

func (fd *FD) FileName() string

func (*FD) FileNameSansExt

func (fd *FD) FileNameSansExt() string

func (*FD) FileNameSansExtRelTo

func (fd *FD) FileNameSansExtRelTo(d string) (string, error)

func (*FD) FilePathRelTo

func (fd *FD) FilePathRelTo(d string) (string, error)

func (*FD) FilePathSansExt

func (fd *FD) FilePathSansExt() string

func (*FD) GetDigest

func (fd *FD) GetDigest() interfaces.MarklId

func (*FD) GetPath

func (fd *FD) GetPath() string

func (*FD) GetState

func (fd *FD) GetState() State

func (*FD) IsDir

func (fd *FD) IsDir() bool

func (*FD) IsEmpty

func (fd *FD) IsEmpty() bool

func (*FD) IsStdin

func (fd *FD) IsStdin() bool

func (*FD) ModTime

func (fd *FD) ModTime() thyme.Time

func (*FD) Remove

func (fd *FD) Remove(directoryLayout directory_layout.Mutable) (err error)

func (*FD) Reset

func (fd *FD) Reset()

func (*FD) ResetWith

func (fd *FD) ResetWith(src *FD)

func (*FD) Set

func (fd *FD) Set(v string) (err error)

func (*FD) SetFileInfoWithDir

func (fd *FD) SetFileInfoWithDir(fi os.FileInfo, dir string) (err error)

func (*FD) SetFromFileInfoWithDir

func (fd *FD) SetFromFileInfoWithDir(
	fileInfo os.FileInfo,
	dir string,
	blobStore interfaces.BlobWriterFactory,
) (err error)

func (*FD) SetFromPath

func (fd *FD) SetFromPath(
	baseDir string,
	path string,
	blobStore interfaces.BlobWriterFactory,
) (err error)

func (*FD) SetIgnoreNotExists

func (fd *FD) SetIgnoreNotExists(v string) (err error)

func (*FD) SetPath

func (fd *FD) SetPath(p string) (err error)

func (*FD) SetPathRel

func (fd *FD) SetPathRel(p, dir string) (err error)

func (*FD) SetShaLike

func (fd *FD) SetShaLike(v interfaces.MarklId) (err error)

func (*FD) SetWithBlobWriterFactory

func (fd *FD) SetWithBlobWriterFactory(
	path string,
	blobStore interfaces.BlobWriterFactory,
) (err error)

func (*FD) String

func (fd *FD) String() string

type KeyerSha

type KeyerSha struct{}

func (KeyerSha) GetKey

func (KeyerSha) GetKey(fd *FD) string

type MutableSet

type MutableSet = interfaces.SetMutable[*FD]

func MakeMutableSet

func MakeMutableSet(ts ...*FD) MutableSet

func MakeMutableSetSha

func MakeMutableSetSha() MutableSet

type Set

type Set = interfaces.Set[*FD]

func MakeSet

func MakeSet(ts ...*FD) Set

type State

type State interface {
	// contains filtered or unexported methods
}

type Std

type Std struct {
	ui.Printer
}

func MakeStd

func MakeStd(f *os.File) Std

Source Files

  • collections_set.go
  • construction.go
  • main.go
  • state.go
  • std.go
  • util.go

Jump to

Keyboard shortcuts

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