env_dir

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDir = "DIR_ZIT"
	EnvBin = "BIN_ZIT"
)

Variables

This section is empty.

Functions

func IsErrBlobMissing

func IsErrBlobMissing(err error) bool

func MakeDefault

func MakeDefault(
	context errors.Context,
	do debug.Options,
) env

func MakeDefaultAndInitialize

func MakeDefaultAndInitialize(
	context errors.Context,
	do debug.Options,
	overrideXDG bool,
) env

func MakeFromXDGDotenvPath

func MakeFromXDGDotenvPath(
	context errors.Context,
	config config_mutable_cli.Config,
	xdgDotenvPath string,
) env

func MakeWithHome

func MakeWithHome(
	context errors.Context,
	home string,
	do debug.Options,
	permitCwdXDGOverride bool,
) (s env)

func MakeWithHomeAndInitialize

func MakeWithHomeAndInitialize(
	context errors.Context,
	home string,
	do debug.Options,
	cwdXDGOverride bool,
) (s env)

func MakeWithXDG

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

func NewFileReader

func NewFileReader(
	options FileReadOptions,
) (readCloser interfaces.ShaReadCloser, err error)

func NewReader

func NewReader(options ReadOptions) (r *reader, err error)

func NewWriter

func NewWriter(o WriteOptions) (w *writer, err error)

Types

type Config

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

func MakeConfig

func MakeConfig(
	compression interfaces.BlobCompression,
	encryption interfaces.BlobEncryption,
	lockInternalFiles bool,
) Config

func MakeConfigFromImmutableBlobConfig

func MakeConfigFromImmutableBlobConfig(
	config interfaces.BlobStoreConfigImmutable,
) Config

func (*Config) GetBlobCompression

func (c *Config) GetBlobCompression() interfaces.BlobCompression

func (*Config) GetBlobEncryption

func (c *Config) GetBlobEncryption() interfaces.BlobEncryption

func (Config) GetBlobStoreConfigImmutable

func (c Config) GetBlobStoreConfigImmutable() interfaces.BlobStoreConfigImmutable

func (Config) GetLockInternalFiles

func (c Config) GetLockInternalFiles() bool

type Env

type Env interface {
	IsDryRun() bool
	GetCwd() string
	GetXDG() xdg.XDG
	GetExecPath() string
	GetTempLocal() TemporaryFS
	MakeDir(ds ...string) (err error)
	MakeDirPerms(perms os.FileMode, ds ...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 ErrAlreadyExists

type ErrAlreadyExists struct {
	sha.Sha
	Path string
}

func MakeErrAlreadyExists

func MakeErrAlreadyExists(
	sh interfaces.Sha,
	path string,
) (err *ErrAlreadyExists)

func (*ErrAlreadyExists) Error

func (e *ErrAlreadyExists) Error() string

func (*ErrAlreadyExists) Is

func (e *ErrAlreadyExists) Is(target error) bool

type ErrBlobMissing

type ErrBlobMissing struct {
	interfaces.ShaGetter
	Path string
}

func (ErrBlobMissing) Error

func (e ErrBlobMissing) Error() string

func (ErrBlobMissing) Is

func (e ErrBlobMissing) Is(target error) bool

type ErrTempAlreadyExists

type ErrTempAlreadyExists struct {
	Path string
}

func MakeErrTempAlreadyExists

func MakeErrTempAlreadyExists(
	path string,
) (err *ErrTempAlreadyExists)

func (*ErrTempAlreadyExists) Error

func (e *ErrTempAlreadyExists) Error() string

func (*ErrTempAlreadyExists) ErrorCause

func (e *ErrTempAlreadyExists) ErrorCause() string

func (*ErrTempAlreadyExists) ErrorRecovery

func (e *ErrTempAlreadyExists) ErrorRecovery() string

func (*ErrTempAlreadyExists) ErrorRecoveryAutomatic

func (e *ErrTempAlreadyExists) ErrorRecoveryAutomatic() string

func (*ErrTempAlreadyExists) Is

func (e *ErrTempAlreadyExists) Is(target error) bool

type FileReadOptions

type FileReadOptions struct {
	Config
	Path string
}

type MoveOptions

type MoveOptions struct {
	Config
	TemporaryFS
	ErrorOnAttemptedOverwrite bool
	FinalPath                 string
	GenerateFinalPathFromSha  bool
}

type Mover

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

func NewMover

func NewMover(o MoveOptions) (m *Mover, err error)

func (*Mover) Close

func (m *Mover) Close() (err error)

func (Mover) GetShaLike

func (w Mover) GetShaLike() (s interfaces.Sha)

func (Mover) ReadFrom

func (w Mover) ReadFrom(r io.Reader) (n int64, err error)

func (Mover) Write

func (w Mover) Write(p []byte) (n int, err error)

func (Mover) WriteString

func (w Mover) WriteString(s string) (n int, err error)

type ReadOptions

type ReadOptions struct {
	Config
	*os.File
}

type RelativePath

type RelativePath interface {
	Rel(string) string
}

type TemporaryFS

type TemporaryFS struct {
	BasePath string
}

func (TemporaryFS) DirTemp

func (s TemporaryFS) DirTemp() (d string, err error)

func (TemporaryFS) DirTempWithTemplate

func (s TemporaryFS) DirTempWithTemplate(
	template string,
) (d string, err error)

func (TemporaryFS) FileTemp

func (s TemporaryFS) FileTemp() (f *os.File, err error)

func (TemporaryFS) FileTempWithTemplate

func (s TemporaryFS) FileTempWithTemplate(t string) (f *os.File, err error)

type WriteOptions

type WriteOptions struct {
	Config
	io.Writer
}

type Writer

type Writer interface {
	sha.WriteCloser
}

Jump to

Keyboard shortcuts

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