env_dir

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDir               = "DIR_DODDER" // TODO chang to dodder-prefixed
	EnvBin               = "BIN_DODDER" // TODO change to dodder-prefixed
	XDGUtilityNameDodder = "dodder"
)

Variables

View Source
var (
	DefaultConfig = Config{
		// contains filtered or unexported fields
	}
)
View Source
var MakeDirIfNecessary = files.MakeDirIfNecessary
View Source
var MakeDirIfNecessaryForStringerWithHeadAndTail = files.MakeDirIfNecessaryForStringerWithHeadAndTail
View Source
var MakeHashBucketPath = files.MakeHashBucketPath
View Source
var MakeHashBucketPathJoinFunc = files.MakeHashBucketPathJoinFunc
View Source
var PathFromHeadAndTail = files.PathFromHeadAndTail

Functions

func IsErrBlobAlreadyExists

func IsErrBlobAlreadyExists(err error) bool

func IsErrBlobMissing

func IsErrBlobMissing(err error) bool

func MakeDefault

func MakeDefault(
	context errors.Context,
	utilityName string,
	debugOptions debug.Options,
) env

func MakeDefaultAndInitialize

func MakeDefaultAndInitialize(
	context errors.Context,
	utilityName string,
	do debug.Options,
	repoId repo_id.Id,
) env

func MakeDefaultNoInit

func MakeDefaultNoInit(
	context errors.Context,
	utilityName string,
	debugOptions debug.Options,
) env

func MakeFromXDGDotenvPath

func MakeFromXDGDotenvPath(
	context errors.Context,
	debugOptions debug.Options,
	xdgDotenvPath string,
) env

func MakeHashBucketPathFromMerkleId

func MakeHashBucketPathFromMerkleId(
	id domain_interfaces.MarklId,
	buckets []int,
	multiHash bool,
	pathComponents ...string,
) string

func MakeWithDefaultHome

func MakeWithDefaultHome(
	context errors.Context,
	utilityName string,
	debugOptions debug.Options,
	permitCwdXDGOverride bool,
	initialize bool,
) (env env)

func MakeWithHomeAndInitialize

func MakeWithHomeAndInitialize(
	context errors.Context,
	utilityName string,
	home string,
	debugOptions debug.Options,
) (env env)

func MakeWithXDG

func MakeWithXDG(
	context errors.Context,
	debugOptions debug.Options,
	xdg xdg.XDG,
) (env env)

func MakeWithXDGRootOverrideHomeAndInitialize

func MakeWithXDGRootOverrideHomeAndInitialize(
	context errors.Context,
	xdgRootOverride string,
	utilityName string,
	debugOptions debug.Options,
) (env env)

func NewFileReaderOrErrNotExist

func NewFileReaderOrErrNotExist(
	config Config,
	path string,
) (blobReader domain_interfaces.BlobReader, err error)

func NewMover

func NewMover(
	config Config,
	moveOptions MoveOptions,
) (domain_interfaces.BlobWriter, error)

func NewNopReader

func NewNopReader() (blobReader domain_interfaces.BlobReader, err error)

func NewReader

func NewReader(
	config Config,
	readSeeker io.ReadSeeker,
) (reader *blobReader, err error)

func NewWriter

func NewWriter(
	config Config,
	ioWriter io.Writer,
) (wrighter *writer, err error)

Types

type Config

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

func MakeConfig

func MakeConfig(
	hashFormat domain_interfaces.FormatHash,
	funcJoin func(string, ...string) string,
	compression interfaces.IOWrapper,
	encryption domain_interfaces.MarklId,
) Config

func (Config) GetBlobCompression

func (config Config) GetBlobCompression() interfaces.IOWrapper

func (Config) GetBlobEncryption

func (config Config) GetBlobEncryption() interfaces.IOWrapper

type Env

type Env interface {
	interfaces.ActiveContextGetter
	interfaces.EnvVarsAdder

	IsDryRun() bool
	GetCwd() string

	GetXDG() xdg.XDG
	GetXDGForBlobStores() xdg.XDG
	GetXDGForBlobStoreId(blob_store_id.Id) xdg.XDG

	GetExecPath() string
	GetTempLocal() TemporaryFS
	MakeDirs(dirs ...string) (err error)
	MakeDirsPerms(perms os.FileMode, dirs ...string) (err error)
	Rel(p string) (out string)
	RelToCwdOrSame(p string) (p1 string)
	MakeCommonEnv() map[string]string
	MakeRelativePathStringFormatWriter() interfaces.StringEncoderTo[string]
	AbsFromCwdOrSame(p string) (p1 string)

	Delete(paths ...string) (err error)
}

type ErrBlobAlreadyExists

type ErrBlobAlreadyExists struct {
	BlobId domain_interfaces.MarklId
	Path   string
}

func MakeErrBlobAlreadyExists

func MakeErrBlobAlreadyExists(
	blobId domain_interfaces.MarklId,
	path string,
) ErrBlobAlreadyExists

func (ErrBlobAlreadyExists) Error

func (err ErrBlobAlreadyExists) Error() string

func (ErrBlobAlreadyExists) GetErrorType

func (err ErrBlobAlreadyExists) GetErrorType() pkgErrDisamb

func (ErrBlobAlreadyExists) Is

func (err ErrBlobAlreadyExists) Is(target error) bool

type ErrBlobMissing

type ErrBlobMissing struct {
	// TODO add blob store
	BlobId domain_interfaces.MarklId
	Path   string
}

TODO create a constructor function to enable debugging

func (ErrBlobMissing) Error

func (err ErrBlobMissing) Error() string

func (ErrBlobMissing) GetErrorType

func (err ErrBlobMissing) GetErrorType() pkgErrDisamb

func (ErrBlobMissing) Is

func (err ErrBlobMissing) Is(target error) bool

type ErrTempAlreadyExists

type ErrTempAlreadyExists struct {
	Path string
}

func MakeErrTempAlreadyExists

func MakeErrTempAlreadyExists(
	path string,
) (err ErrTempAlreadyExists)

func (ErrTempAlreadyExists) Error

func (err ErrTempAlreadyExists) Error() string

func (ErrTempAlreadyExists) GetErrorCause

func (err ErrTempAlreadyExists) GetErrorCause() []string

func (ErrTempAlreadyExists) GetErrorRecovery

func (err ErrTempAlreadyExists) GetErrorRecovery() []string

func (ErrTempAlreadyExists) GetErrorType

func (err ErrTempAlreadyExists) GetErrorType() pkgErrDisamb

func (ErrTempAlreadyExists) Is

func (err ErrTempAlreadyExists) Is(target error) bool

type MoveOptions

type MoveOptions struct {
	TemporaryFS
	ErrorOnAttemptedOverwrite   bool
	FinalPathOrDir              string
	GenerateFinalPathFromDigest bool
}

type RelativePath

type RelativePath interface {
	Rel(string) string
}

type TemporaryFS

type TemporaryFS = files.TemporaryFS

Source Files

  • before_xdg.go
  • blob_config.go
  • blob_mover.go
  • blob_reader.go
  • blob_writer.go
  • construction.go
  • delete.go
  • errors.go
  • main.go
  • rel.go
  • temp.go
  • util.go

Jump to

Keyboard shortcuts

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