Documentation ¶
Index ¶
- Constants
- Variables
- func DiffPatch(path RelPath, fromData []byte, fromMode os.FileMode, toData []byte, ...) (diff.Patch, error)
- func FQDNHostname(fs vfs.FS) (string, error)
- func KernelInfo(fs vfs.FS) (map[string]string, error)
- func MkdirAll(system System, absPath AbsPath, perm os.FileMode) error
- func OSRelease(fs vfs.FS) (map[string]string, error)
- func PersistentStateData(s PersistentState) (interface{}, error)
- func ShellQuoteArgs(args []string) string
- func SuspiciousSourceDirEntry(base string, info os.FileInfo) bool
- func Walk(system System, rootAbsPath AbsPath, ...) error
- type AGEEncryption
- type AbsPath
- type AbsPaths
- type ActualStateAbsent
- type ActualStateDir
- type ActualStateEntry
- type ActualStateFile
- type ActualStateSymlink
- type AddOptions
- type ApplyOptions
- type BoltPersistentState
- func (b *BoltPersistentState) Close() error
- func (b *BoltPersistentState) CopyTo(p PersistentState) error
- func (b *BoltPersistentState) Delete(bucket, key []byte) error
- func (b *BoltPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
- func (b *BoltPersistentState) Get(bucket, key []byte) ([]byte, error)
- func (b *BoltPersistentState) Set(bucket, key, value []byte) error
- type BoltPersistentStateMode
- type DebugEncryption
- type DebugPersistentState
- func (s *DebugPersistentState) Close() error
- func (s *DebugPersistentState) CopyTo(p PersistentState) error
- func (s *DebugPersistentState) Delete(bucket, key []byte) error
- func (s *DebugPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
- func (s *DebugPersistentState) Get(bucket, key []byte) ([]byte, error)
- func (s *DebugPersistentState) Set(bucket, key, value []byte) error
- type DebugSystem
- func (s *DebugSystem) Chmod(name AbsPath, mode os.FileMode) error
- func (s *DebugSystem) Glob(name string) ([]string, error)
- func (s *DebugSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *DebugSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *DebugSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (s *DebugSystem) RawPath(path AbsPath) (AbsPath, error)
- func (s *DebugSystem) ReadDir(name AbsPath) ([]os.FileInfo, error)
- func (s *DebugSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *DebugSystem) Readlink(name AbsPath) (string, error)
- func (s *DebugSystem) RemoveAll(name AbsPath) error
- func (s *DebugSystem) Rename(oldpath, newpath AbsPath) error
- func (s *DebugSystem) RunCmd(cmd *exec.Cmd) error
- func (s *DebugSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (s *DebugSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *DebugSystem) UnderlyingFS() vfs.FS
- func (s *DebugSystem) WriteFile(name AbsPath, data []byte, perm os.FileMode) error
- func (s *DebugSystem) WriteSymlink(oldname string, newname AbsPath) error
- type DirAttr
- type DryRunSystem
- func (s *DryRunSystem) Chmod(name AbsPath, mode os.FileMode) error
- func (s *DryRunSystem) Glob(pattern string) ([]string, error)
- func (s *DryRunSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *DryRunSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *DryRunSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (s *DryRunSystem) Modified() bool
- func (s *DryRunSystem) RawPath(path AbsPath) (AbsPath, error)
- func (s *DryRunSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (s *DryRunSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *DryRunSystem) Readlink(name AbsPath) (string, error)
- func (s *DryRunSystem) RemoveAll(AbsPath) error
- func (s *DryRunSystem) Rename(oldpath, newpath AbsPath) error
- func (s *DryRunSystem) RunCmd(cmd *exec.Cmd) error
- func (s *DryRunSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (s *DryRunSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *DryRunSystem) UnderlyingFS() vfs.FS
- func (s *DryRunSystem) WriteFile(AbsPath, []byte, os.FileMode) error
- func (s *DryRunSystem) WriteSymlink(string, AbsPath) error
- type DumpSystem
- func (DumpSystem) Chmod(name AbsPath, perm os.FileMode) error
- func (s *DumpSystem) Data() interface{}
- func (DumpSystem) Glob(pattern string) ([]string, error)
- func (DumpSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (DumpSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *DumpSystem) Mkdir(dirname AbsPath, perm os.FileMode) error
- func (DumpSystem) RawPath(path AbsPath) (AbsPath, error)
- func (DumpSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (DumpSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (DumpSystem) Readlink(name AbsPath) (string, error)
- func (DumpSystem) RemoveAll(name AbsPath) error
- func (DumpSystem) Rename(oldpath, newpath AbsPath) error
- func (DumpSystem) RunCmd(cmd *exec.Cmd) error
- func (s *DumpSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (DumpSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *DumpSystem) UnderlyingFS() vfs.FS
- func (s *DumpSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (s *DumpSystem) WriteSymlink(oldname string, newname AbsPath) error
- type Encryption
- type EntryState
- type EntryStateType
- type FileAttr
- type Format
- type GPGEncryption
- type GitDiffSystem
- func (s *GitDiffSystem) Chmod(name AbsPath, mode os.FileMode) error
- func (s *GitDiffSystem) Glob(pattern string) ([]string, error)
- func (s *GitDiffSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *GitDiffSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *GitDiffSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (s *GitDiffSystem) RawPath(path AbsPath) (AbsPath, error)
- func (s *GitDiffSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (s *GitDiffSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *GitDiffSystem) Readlink(name AbsPath) (string, error)
- func (s *GitDiffSystem) RemoveAll(name AbsPath) error
- func (s *GitDiffSystem) Rename(oldpath, newpath AbsPath) error
- func (s *GitDiffSystem) RunCmd(cmd *exec.Cmd) error
- func (s *GitDiffSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (s *GitDiffSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *GitDiffSystem) UnderlyingFS() vfs.FS
- func (s *GitDiffSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (s *GitDiffSystem) WriteSymlink(oldname string, newname AbsPath) error
- type IncludeBits
- type IncludeSet
- func (s *IncludeSet) IncludeActualStateEntry(actualStateEntry ActualStateEntry) bool
- func (s *IncludeSet) IncludeFileInfo(info os.FileInfo) bool
- func (s *IncludeSet) IncludeTargetStateEntry(targetStateEntry TargetStateEntry) bool
- func (s *IncludeSet) Set(str string) error
- func (s *IncludeSet) String() string
- func (s *IncludeSet) Type() string
- type MockPersistentState
- func (s *MockPersistentState) Close() error
- func (s *MockPersistentState) CopyTo(p PersistentState) error
- func (s *MockPersistentState) Delete(bucket, key []byte) error
- func (s *MockPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
- func (s *MockPersistentState) Get(bucket, key []byte) ([]byte, error)
- func (s *MockPersistentState) Set(bucket, key, value []byte) error
- type NoEncryption
- type NullPersistentState
- func (NullPersistentState) Close() error
- func (NullPersistentState) CopyTo(s PersistentState) error
- func (NullPersistentState) Delete(bucket, key []byte) error
- func (NullPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
- func (NullPersistentState) Get(bucket, key []byte) ([]byte, error)
- func (NullPersistentState) Set(bucket, key, value []byte) error
- type PersistentState
- type PreApplyFunc
- type ReadOnlySystem
- func (ReadOnlySystem) Chmod(name AbsPath, perm os.FileMode) error
- func (s *ReadOnlySystem) Glob(pattern string) ([]string, error)
- func (s *ReadOnlySystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *ReadOnlySystem) Lstat(filename AbsPath) (os.FileInfo, error)
- func (ReadOnlySystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (s *ReadOnlySystem) RawPath(path AbsPath) (AbsPath, error)
- func (s *ReadOnlySystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (s *ReadOnlySystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *ReadOnlySystem) Readlink(name AbsPath) (string, error)
- func (ReadOnlySystem) RemoveAll(name AbsPath) error
- func (ReadOnlySystem) Rename(oldpath, newpath AbsPath) error
- func (ReadOnlySystem) RunCmd(cmd *exec.Cmd) error
- func (ReadOnlySystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (s *ReadOnlySystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *ReadOnlySystem) UnderlyingFS() vfs.FS
- func (ReadOnlySystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (ReadOnlySystem) WriteSymlink(oldname string, newname AbsPath) error
- type RealSystem
- func (s *RealSystem) Chmod(name AbsPath, mode os.FileMode) error
- func (s *RealSystem) Glob(pattern string) ([]string, error)
- func (s *RealSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *RealSystem) Lstat(filename AbsPath) (os.FileInfo, error)
- func (s *RealSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (s *RealSystem) PathSeparator() rune
- func (s *RealSystem) RawPath(absPath AbsPath) (AbsPath, error)
- func (s *RealSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (s *RealSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *RealSystem) Readlink(name AbsPath) (string, error)
- func (s *RealSystem) RemoveAll(name AbsPath) error
- func (s *RealSystem) Rename(oldpath, newpath AbsPath) error
- func (s *RealSystem) RunCmd(cmd *exec.Cmd) error
- func (s *RealSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) (err error)
- func (s *RealSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (s *RealSystem) UnderlyingFS() vfs.FS
- func (s *RealSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (s *RealSystem) WriteSymlink(oldname string, newname AbsPath) error
- type RelPath
- type RelPaths
- type SourceFileTargetType
- type SourceRelPath
- func (p SourceRelPath) Dir() SourceRelPath
- func (p SourceRelPath) Empty() bool
- func (p SourceRelPath) Join(elems ...SourceRelPath) SourceRelPath
- func (p SourceRelPath) RelPath() RelPath
- func (p SourceRelPath) Split() (SourceRelPath, SourceRelPath)
- func (p SourceRelPath) String() string
- func (p SourceRelPath) TargetRelPath() RelPath
- type SourceRelPaths
- type SourceState
- func (s *SourceState) Add(sourceSystem System, persistentState PersistentState, destSystem System, ...) error
- func (s *SourceState) AddDestAbsPathInfos(destAbsPathInfos map[AbsPath]os.FileInfo, system System, destAbsPath AbsPath, ...) error
- func (s *SourceState) Apply(targetSystem System, persistentState PersistentState, targetDir AbsPath, ...) error
- func (s *SourceState) Entries() map[RelPath]SourceStateEntry
- func (s *SourceState) Entry(targetRelPath RelPath) (SourceStateEntry, bool)
- func (s *SourceState) ExecuteTemplateData(name string, data []byte) ([]byte, error)
- func (s *SourceState) Ignored(targetRelPath RelPath) bool
- func (s *SourceState) MinVersion() semver.Version
- func (s *SourceState) MustEntry(targetRelPath RelPath) SourceStateEntry
- func (s *SourceState) Read() error
- func (s *SourceState) TargetRelPaths() RelPaths
- func (s *SourceState) TemplateData() map[string]interface{}
- type SourceStateDir
- type SourceStateEntry
- type SourceStateFile
- func (lc SourceStateFile) Contents() ([]byte, error)
- func (lc SourceStateFile) ContentsSHA256() ([]byte, error)
- func (s *SourceStateFile) Evaluate() error
- func (s *SourceStateFile) Order() int
- func (s *SourceStateFile) SourceRelPath() SourceRelPath
- func (s *SourceStateFile) TargetStateEntry() (TargetStateEntry, error)
- type SourceStateOption
- func WithDefaultTemplateDataFunc(defaultTemplateDataFunc func() map[string]interface{}) SourceStateOption
- func WithDestDir(destDirAbsPath AbsPath) SourceStateOption
- func WithEncryption(encryption Encryption) SourceStateOption
- func WithPriorityTemplateData(priorityTemplateData map[string]interface{}) SourceStateOption
- func WithSourceDir(sourceDirAbsPath AbsPath) SourceStateOption
- func WithSystem(system System) SourceStateOption
- func WithTemplateFuncs(templateFuncs template.FuncMap) SourceStateOption
- func WithTemplateOptions(templateOptions []string) SourceStateOption
- type SourceStateRemove
- type SourceStateRenameDir
- type System
- type TARReaderSystem
- func (TARReaderSystem) Chmod(name AbsPath, perm os.FileMode) error
- func (s *TARReaderSystem) FileInfos() map[AbsPath]os.FileInfo
- func (TARReaderSystem) Glob(pattern string) ([]string, error)
- func (TARReaderSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (s *TARReaderSystem) Lstat(filename AbsPath) (os.FileInfo, error)
- func (TARReaderSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (TARReaderSystem) RawPath(path AbsPath) (AbsPath, error)
- func (TARReaderSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (s *TARReaderSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (s *TARReaderSystem) Readlink(name AbsPath) (string, error)
- func (TARReaderSystem) RemoveAll(name AbsPath) error
- func (TARReaderSystem) Rename(oldpath, newpath AbsPath) error
- func (TARReaderSystem) RunCmd(cmd *exec.Cmd) error
- func (TARReaderSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (TARReaderSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (TARReaderSystem) UnderlyingFS() vfs.FS
- func (TARReaderSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (TARReaderSystem) WriteSymlink(oldname string, newname AbsPath) error
- type TARReaderSystemOptions
- type TARWriterSystem
- func (TARWriterSystem) Chmod(name AbsPath, perm os.FileMode) error
- func (s *TARWriterSystem) Close() error
- func (TARWriterSystem) Glob(pattern string) ([]string, error)
- func (TARWriterSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (TARWriterSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *TARWriterSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (TARWriterSystem) RawPath(path AbsPath) (AbsPath, error)
- func (TARWriterSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (TARWriterSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (TARWriterSystem) Readlink(name AbsPath) (string, error)
- func (TARWriterSystem) RemoveAll(name AbsPath) error
- func (TARWriterSystem) Rename(oldpath, newpath AbsPath) error
- func (TARWriterSystem) RunCmd(cmd *exec.Cmd) error
- func (s *TARWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (TARWriterSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (TARWriterSystem) UnderlyingFS() vfs.FS
- func (s *TARWriterSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (s *TARWriterSystem) WriteSymlink(oldname string, newname AbsPath) error
- type TargetStateAbsent
- func (t *TargetStateAbsent) Apply(system System, persistentState PersistentState, ...) error
- func (t *TargetStateAbsent) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStateAbsent) Evaluate() error
- func (t *TargetStateAbsent) SkipApply(persistentState PersistentState) (bool, error)
- type TargetStateDir
- type TargetStateEntry
- type TargetStateFile
- func (t *TargetStateFile) Apply(system System, persistentState PersistentState, ...) error
- func (lc TargetStateFile) Contents() ([]byte, error)
- func (lc TargetStateFile) ContentsSHA256() ([]byte, error)
- func (t *TargetStateFile) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStateFile) Evaluate() error
- func (t *TargetStateFile) SkipApply(persistentState PersistentState) (bool, error)
- type TargetStatePresent
- func (t *TargetStatePresent) Apply(system System, persistentState PersistentState, ...) error
- func (lc TargetStatePresent) Contents() ([]byte, error)
- func (lc TargetStatePresent) ContentsSHA256() ([]byte, error)
- func (t *TargetStatePresent) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStatePresent) Evaluate() error
- func (t *TargetStatePresent) SkipApply(persistentState PersistentState) (bool, error)
- type TargetStateRenameDir
- func (t *TargetStateRenameDir) Apply(system System, persistentState PersistentState, ...) error
- func (t *TargetStateRenameDir) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStateRenameDir) Evaluate() error
- func (t *TargetStateRenameDir) SkipApply(persistentState PersistentState) (bool, error)
- type TargetStateScript
- func (t *TargetStateScript) Apply(system System, persistentState PersistentState, ...) error
- func (lc TargetStateScript) Contents() ([]byte, error)
- func (lc TargetStateScript) ContentsSHA256() ([]byte, error)
- func (t *TargetStateScript) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStateScript) Evaluate() error
- func (t *TargetStateScript) SkipApply(persistentState PersistentState) (bool, error)
- type TargetStateSymlink
- func (t *TargetStateSymlink) Apply(system System, persistentState PersistentState, ...) error
- func (t *TargetStateSymlink) EntryState(umask os.FileMode) (*EntryState, error)
- func (t *TargetStateSymlink) Evaluate() error
- func (ll TargetStateSymlink) Linkname() (string, error)
- func (ll TargetStateSymlink) LinknameSHA256() ([]byte, error)
- func (t *TargetStateSymlink) SkipApply(persistentState PersistentState) (bool, error)
- type ZIPWriterSystem
- func (ZIPWriterSystem) Chmod(name AbsPath, perm os.FileMode) error
- func (s *ZIPWriterSystem) Close() error
- func (ZIPWriterSystem) Glob(pattern string) ([]string, error)
- func (ZIPWriterSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
- func (ZIPWriterSystem) Lstat(name AbsPath) (os.FileInfo, error)
- func (s *ZIPWriterSystem) Mkdir(name AbsPath, perm os.FileMode) error
- func (ZIPWriterSystem) RawPath(path AbsPath) (AbsPath, error)
- func (ZIPWriterSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
- func (ZIPWriterSystem) ReadFile(filename AbsPath) ([]byte, error)
- func (ZIPWriterSystem) Readlink(name AbsPath) (string, error)
- func (ZIPWriterSystem) RemoveAll(name AbsPath) error
- func (ZIPWriterSystem) Rename(oldpath, newpath AbsPath) error
- func (ZIPWriterSystem) RunCmd(cmd *exec.Cmd) error
- func (s *ZIPWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
- func (ZIPWriterSystem) Stat(name AbsPath) (os.FileInfo, error)
- func (ZIPWriterSystem) UnderlyingFS() vfs.FS
- func (s *ZIPWriterSystem) WriteFile(filename AbsPath, data []byte, perm os.FileMode) error
- func (s *ZIPWriterSystem) WriteSymlink(oldname string, newname AbsPath) error
Constants ¶
const (
Prefix = ".chezmoi"
)
Special file names.
const (
TemplateSuffix = ".tmpl"
)
Suffixes and prefixes.
Variables ¶
var ( // DefaultTemplateOptions are the default template options. DefaultTemplateOptions = []string{"missingkey=error"} // Skip indicates that entry should be skipped. Skip = filepath.SkipDir // Umask is the process's umask. Umask = os.FileMode(0) )
var Formats = map[string]Format{ "json": JSONFormat, "toml": TOMLFormat, "yaml": YAMLFormat, }
Formats is a map of all Formats by name.
Functions ¶
func DiffPatch ¶
func DiffPatch(path RelPath, fromData []byte, fromMode os.FileMode, toData []byte, toMode os.FileMode) (diff.Patch, error)
DiffPatch returns a github.com/go-git/go-git/plumbing/format/diff.Patch for path from the given data and mode to the given data and mode.
func FQDNHostname ¶
FQDNHostname returns the FQDN hostname.
func KernelInfo ¶
KernelInfo returns the kernel information parsed from /proc/sys/kernel.
func OSRelease ¶
OSRelease returns the operating system identification data as defined by the os-release specification.
func PersistentStateData ¶
func PersistentStateData(s PersistentState) (interface{}, error)
PersistentStateData returns the structured data in s.
func ShellQuoteArgs ¶
ShellQuoteArgs returs args shell quoted and joined into a single string.
func SuspiciousSourceDirEntry ¶
SuspiciousSourceDirEntry returns true if base is a suspicous dir entry.
Types ¶
type AGEEncryption ¶
type AGEEncryption struct { Command string Args []string Identity string Identities []string Recipient string Recipients []string RecipientsFile string RecipientsFiles []string }
An AGEEncryption uses age for encryption and decryption. See https://github.com/FiloSottile/age.
func (*AGEEncryption) Decrypt ¶
func (t *AGEEncryption) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt implements Encyrption.Decrypt.
func (*AGEEncryption) DecryptToFile ¶
func (t *AGEEncryption) DecryptToFile(filename string, ciphertext []byte) error
DecryptToFile implements Encryption.DecryptToFile.
func (*AGEEncryption) Encrypt ¶
func (t *AGEEncryption) Encrypt(plaintext []byte) ([]byte, error)
Encrypt implements Encryption.Encrypt.
func (*AGEEncryption) EncryptFile ¶
func (t *AGEEncryption) EncryptFile(filename string) ([]byte, error)
EncryptFile implements Encryption.EncryptFile.
type AbsPath ¶
type AbsPath string
An AbsPath is an absolute path.
func NewAbsPathFromExtPath ¶
NewAbsPathFromExtPath returns a new AbsPath by converting extPath to use slashes, performing tilde expansion, and making the path absolute.
func NormalizePath ¶
NormalizePath returns path normalized. On non-Windows systems, normalized paths are absolute paths.
func (AbsPath) MustTrimDirPrefix ¶
MustTrimDirPrefix is like TrimPrefix but panics on any error.
type AbsPaths ¶
type AbsPaths []AbsPath
AbsPaths is a slice of AbsPaths that implements sort.Interface.
type ActualStateAbsent ¶
type ActualStateAbsent struct {
// contains filtered or unexported fields
}
A ActualStateAbsent represents the absence of an entry in the filesystem.
func (*ActualStateAbsent) EntryState ¶
func (s *ActualStateAbsent) EntryState() (*EntryState, error)
EntryState returns d's entry state.
func (*ActualStateAbsent) Remove ¶
func (s *ActualStateAbsent) Remove(system System) error
Remove removes d.
type ActualStateDir ¶
type ActualStateDir struct {
// contains filtered or unexported fields
}
A ActualStateDir represents the state of a directory in the filesystem.
func (*ActualStateDir) EntryState ¶
func (s *ActualStateDir) EntryState() (*EntryState, error)
EntryState returns d's entry state.
func (*ActualStateDir) Remove ¶
func (s *ActualStateDir) Remove(system System) error
Remove removes d.
type ActualStateEntry ¶
type ActualStateEntry interface { EntryState() (*EntryState, error) Path() AbsPath Remove(system System) error }
An ActualStateEntry represents the actual state of an entry in the filesystem.
func NewActualStateEntry ¶
func NewActualStateEntry(system System, absPath AbsPath, info os.FileInfo, err error) (ActualStateEntry, error)
NewActualStateEntry returns a new ActualStateEntry populated with absPath from fs.
type ActualStateFile ¶
type ActualStateFile struct {
// contains filtered or unexported fields
}
A ActualStateFile represents the state of a file in the filesystem.
func (ActualStateFile) ContentsSHA256 ¶
ContentsSHA256 returns the SHA256 sum of lc's contents.
func (*ActualStateFile) EntryState ¶
func (s *ActualStateFile) EntryState() (*EntryState, error)
EntryState returns d's entry state.
func (*ActualStateFile) Remove ¶
func (s *ActualStateFile) Remove(system System) error
Remove removes d.
type ActualStateSymlink ¶
type ActualStateSymlink struct {
// contains filtered or unexported fields
}
A ActualStateSymlink represents the state of a symlink in the filesystem.
func (*ActualStateSymlink) EntryState ¶
func (s *ActualStateSymlink) EntryState() (*EntryState, error)
EntryState returns d's entry state.
func (ActualStateSymlink) LinknameSHA256 ¶
LinknameSHA256 returns the SHA256 sum of ll's linkname.
func (*ActualStateSymlink) Path ¶
func (s *ActualStateSymlink) Path() AbsPath
Path returns d's path.
func (*ActualStateSymlink) Remove ¶
func (s *ActualStateSymlink) Remove(system System) error
Remove removes d.
type AddOptions ¶
type AddOptions struct { AutoTemplate bool Empty bool Encrypt bool Exact bool Exists bool Include *IncludeSet RemoveDir RelPath Template bool }
AddOptions are options to SourceState.Add.
type ApplyOptions ¶
type ApplyOptions struct { Include *IncludeSet PreApplyFunc PreApplyFunc SkipEncrypted bool Umask os.FileMode }
ApplyOptions are options to SourceState.ApplyAll and SourceState.ApplyOne.
type BoltPersistentState ¶
type BoltPersistentState struct {
// contains filtered or unexported fields
}
A BoltPersistentState is a state persisted with bolt.
func NewBoltPersistentState ¶
func NewBoltPersistentState(system System, path AbsPath, mode BoltPersistentStateMode) (*BoltPersistentState, error)
NewBoltPersistentState returns a new BoltPersistentState.
func (*BoltPersistentState) CopyTo ¶
func (b *BoltPersistentState) CopyTo(p PersistentState) error
CopyTo copies b to p.
func (*BoltPersistentState) Delete ¶
func (b *BoltPersistentState) Delete(bucket, key []byte) error
Delete deletes the value associate with key in bucket. If bucket or key does not exist then Delete does nothing.
func (*BoltPersistentState) ForEach ¶
func (b *BoltPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
ForEach calls fn for each key, value pair in bucket.
func (*BoltPersistentState) Get ¶
func (b *BoltPersistentState) Get(bucket, key []byte) ([]byte, error)
Get returns the value associated with key in bucket.
func (*BoltPersistentState) Set ¶
func (b *BoltPersistentState) Set(bucket, key, value []byte) error
Set sets the value associated with key in bucket. bucket will be created if it does not already exist.
type BoltPersistentStateMode ¶
type BoltPersistentStateMode int
A BoltPersistentStateMode is a mode for opening a PersistentState.
const ( BoltPersistentStateReadOnly BoltPersistentStateMode = iota BoltPersistentStateReadWrite )
PersistentStateModes.
type DebugEncryption ¶
type DebugEncryption struct {
// contains filtered or unexported fields
}
A DebugEncryption logs all calls to an Encryption.
func NewDebugEncryption ¶
func NewDebugEncryption(encryption Encryption) *DebugEncryption
NewDebugEncryption returns a new DebugEncryption.
func (*DebugEncryption) Decrypt ¶
func (e *DebugEncryption) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt implements Encryption.Decrypt.
func (*DebugEncryption) DecryptToFile ¶
func (e *DebugEncryption) DecryptToFile(filename string, ciphertext []byte) error
DecryptToFile implements Encryption.DecryptToFile.
func (*DebugEncryption) Encrypt ¶
func (e *DebugEncryption) Encrypt(plaintext []byte) ([]byte, error)
Encrypt implements Encryption.Encrypt.
func (*DebugEncryption) EncryptFile ¶
func (e *DebugEncryption) EncryptFile(filename string) ([]byte, error)
EncryptFile implements Encryption.EncryptFile.
type DebugPersistentState ¶
type DebugPersistentState struct {
// contains filtered or unexported fields
}
A DebugPersistentState logs calls to a PersistentState.
func NewDebugPersistentState ¶
func NewDebugPersistentState(persistentState PersistentState) *DebugPersistentState
NewDebugPersistentState returns a new debugPersistentState.
func (*DebugPersistentState) Close ¶
func (s *DebugPersistentState) Close() error
Close implements PersistentState.Close.
func (*DebugPersistentState) CopyTo ¶
func (s *DebugPersistentState) CopyTo(p PersistentState) error
CopyTo implements PersistentState.CopyTo.
func (*DebugPersistentState) Delete ¶
func (s *DebugPersistentState) Delete(bucket, key []byte) error
Delete implements PersistentState.Delete.
func (*DebugPersistentState) ForEach ¶
func (s *DebugPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
ForEach implements PersistentState.ForEach.
func (*DebugPersistentState) Get ¶
func (s *DebugPersistentState) Get(bucket, key []byte) ([]byte, error)
Get implements PersistentState.Get.
func (*DebugPersistentState) Set ¶
func (s *DebugPersistentState) Set(bucket, key, value []byte) error
Set implements PersistentState.Set.
type DebugSystem ¶
type DebugSystem struct {
// contains filtered or unexported fields
}
A DebugSystem logs all calls to a System.
func NewDebugSystem ¶
func NewDebugSystem(system System) *DebugSystem
NewDebugSystem returns a new DebugSystem.
func (*DebugSystem) Chmod ¶
func (s *DebugSystem) Chmod(name AbsPath, mode os.FileMode) error
Chmod implements System.Chmod.
func (*DebugSystem) Glob ¶
func (s *DebugSystem) Glob(name string) ([]string, error)
Glob implements System.Glob.
func (*DebugSystem) IdempotentCmdOutput ¶
func (s *DebugSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
IdempotentCmdOutput implements System.IdempotentCmdOutput.
func (*DebugSystem) Lstat ¶
func (s *DebugSystem) Lstat(name AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*DebugSystem) Mkdir ¶
func (s *DebugSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*DebugSystem) RawPath ¶
func (s *DebugSystem) RawPath(path AbsPath) (AbsPath, error)
RawPath implements System.RawPath.
func (*DebugSystem) ReadDir ¶
func (s *DebugSystem) ReadDir(name AbsPath) ([]os.FileInfo, error)
ReadDir implements System.ReadDir.
func (*DebugSystem) ReadFile ¶
func (s *DebugSystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*DebugSystem) Readlink ¶
func (s *DebugSystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (*DebugSystem) RemoveAll ¶
func (s *DebugSystem) RemoveAll(name AbsPath) error
RemoveAll implements System.RemoveAll.
func (*DebugSystem) Rename ¶
func (s *DebugSystem) Rename(oldpath, newpath AbsPath) error
Rename implements System.Rename.
func (*DebugSystem) RunCmd ¶
func (s *DebugSystem) RunCmd(cmd *exec.Cmd) error
RunCmd implements System.RunCmd.
func (*DebugSystem) RunScript ¶
func (s *DebugSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (*DebugSystem) Stat ¶
func (s *DebugSystem) Stat(name AbsPath) (os.FileInfo, error)
Stat implements System.Stat.
func (*DebugSystem) UnderlyingFS ¶
func (s *DebugSystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (*DebugSystem) WriteSymlink ¶
func (s *DebugSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
type DirAttr ¶
DirAttr holds attributes parsed from a source directory name.
func (DirAttr) SourceName ¶
SourceName returns da's source name.
type DryRunSystem ¶
type DryRunSystem struct {
// contains filtered or unexported fields
}
DryRunSystem is an System that reads from, but does not write to, to a wrapped System.
func NewDryRunSystem ¶
func NewDryRunSystem(system System) *DryRunSystem
NewDryRunSystem returns a new DryRunSystem that wraps fs.
func (*DryRunSystem) Chmod ¶
func (s *DryRunSystem) Chmod(name AbsPath, mode os.FileMode) error
Chmod implements System.Chmod.
func (*DryRunSystem) Glob ¶
func (s *DryRunSystem) Glob(pattern string) ([]string, error)
Glob implements System.Glob.
func (*DryRunSystem) IdempotentCmdOutput ¶
func (s *DryRunSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
IdempotentCmdOutput implements System.IdempotentCmdOutput.
func (*DryRunSystem) Lstat ¶
func (s *DryRunSystem) Lstat(name AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*DryRunSystem) Mkdir ¶
func (s *DryRunSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*DryRunSystem) Modified ¶
func (s *DryRunSystem) Modified() bool
Modified returns true if a method that would have modified the wrapped system has been called.
func (*DryRunSystem) RawPath ¶
func (s *DryRunSystem) RawPath(path AbsPath) (AbsPath, error)
RawPath implements System.RawPath.
func (*DryRunSystem) ReadDir ¶
func (s *DryRunSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
ReadDir implements System.ReadDir.
func (*DryRunSystem) ReadFile ¶
func (s *DryRunSystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*DryRunSystem) Readlink ¶
func (s *DryRunSystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (*DryRunSystem) RemoveAll ¶
func (s *DryRunSystem) RemoveAll(AbsPath) error
RemoveAll implements System.RemoveAll.
func (*DryRunSystem) Rename ¶
func (s *DryRunSystem) Rename(oldpath, newpath AbsPath) error
Rename implements System.Rename.
func (*DryRunSystem) RunCmd ¶
func (s *DryRunSystem) RunCmd(cmd *exec.Cmd) error
RunCmd implements System.RunCmd.
func (*DryRunSystem) RunScript ¶
func (s *DryRunSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (*DryRunSystem) Stat ¶
func (s *DryRunSystem) Stat(name AbsPath) (os.FileInfo, error)
Stat implements System.Stat.
func (*DryRunSystem) UnderlyingFS ¶
func (s *DryRunSystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (*DryRunSystem) WriteSymlink ¶
func (s *DryRunSystem) WriteSymlink(string, AbsPath) error
WriteSymlink implements System.WriteSymlink.
type DumpSystem ¶
type DumpSystem struct {
// contains filtered or unexported fields
}
A DumpSystem is a System that writes to a data file.
func NewDumpSystem ¶
func NewDumpSystem() *DumpSystem
NewDumpSystem returns a new DumpSystem that accumulates data.
func (DumpSystem) IdempotentCmdOutput ¶
func (*DumpSystem) Mkdir ¶
func (s *DumpSystem) Mkdir(dirname AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*DumpSystem) RunScript ¶
func (s *DumpSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (*DumpSystem) UnderlyingFS ¶
func (s *DumpSystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (*DumpSystem) WriteSymlink ¶
func (s *DumpSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
type Encryption ¶
type Encryption interface { Decrypt(ciphertext []byte) ([]byte, error) DecryptToFile(filename string, ciphertext []byte) error Encrypt(plaintext []byte) ([]byte, error) EncryptFile(filename string) ([]byte, error) }
An Encryption encrypts and decrypts files and data.
type EntryState ¶
type EntryState struct { Type EntryStateType `json:"type" toml:"type" yaml:"type"` Mode os.FileMode `json:"mode,omitempty" toml:"mode,omitempty" yaml:"mode,omitempty"` ContentsSHA256 hexBytes `json:"contentsSHA256,omitempty" toml:"contentsSHA256,omitempty" yaml:"contentsSHA256,omitempty"` // contains filtered or unexported fields }
An EntryState represents the state of an entry. A nil EntryState is equivalent to EntryStateTypeAbsent.
func (*EntryState) Contents ¶
func (s *EntryState) Contents() []byte
Contents returns s's contents, if available.
func (*EntryState) Equal ¶
func (s *EntryState) Equal(other *EntryState) bool
Equal returns true if s is equal to other.
func (*EntryState) Equivalent ¶
func (s *EntryState) Equivalent(other *EntryState) bool
Equivalent returns true if s is equivalent to other.
type EntryStateType ¶
type EntryStateType string
An EntryStateType is an entry state type.
const ( EntryStateTypeAbsent EntryStateType = "absent" EntryStateTypePresent EntryStateType = "present" EntryStateTypeDir EntryStateType = "dir" EntryStateTypeFile EntryStateType = "file" EntryStateTypeSymlink EntryStateType = "symlink" EntryStateTypeScript EntryStateType = "script" )
Entry state types.
type FileAttr ¶
type FileAttr struct { TargetName string Type SourceFileTargetType Empty bool Encrypted bool Executable bool Once bool Order int Private bool Template bool }
A FileAttr holds attributes parsed from a source file name.
func (FileAttr) SourceName ¶
SourceName returns fa's source name.
type Format ¶
type Format interface { Marshal(value interface{}) ([]byte, error) Name() string Unmarshal(data []byte, value interface{}) error }
A Format is a serialization format.
type GPGEncryption ¶
A GPGEncryption uses gpg for encryption and decryption. See https://gnupg.org/.
func (*GPGEncryption) Decrypt ¶
func (t *GPGEncryption) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt implements Encyrption.Decrypt.
func (*GPGEncryption) DecryptToFile ¶
func (t *GPGEncryption) DecryptToFile(filename string, ciphertext []byte) error
DecryptToFile implements Encryption.DecryptToFile.
func (*GPGEncryption) Encrypt ¶
func (t *GPGEncryption) Encrypt(plaintext []byte) ([]byte, error)
Encrypt implements Encryption.Encrypt.
func (*GPGEncryption) EncryptFile ¶
func (t *GPGEncryption) EncryptFile(filename string) (ciphertext []byte, err error)
EncryptFile implements Encryption.EncryptFile.
type GitDiffSystem ¶
type GitDiffSystem struct {
// contains filtered or unexported fields
}
A GitDiffSystem wraps a System and logs all of the actions executed as a git diff.
func NewGitDiffSystem ¶
NewGitDiffSystem returns a new GitDiffSystem.
func (*GitDiffSystem) Chmod ¶
func (s *GitDiffSystem) Chmod(name AbsPath, mode os.FileMode) error
Chmod implements System.Chmod.
func (*GitDiffSystem) Glob ¶
func (s *GitDiffSystem) Glob(pattern string) ([]string, error)
Glob implements System.Glob.
func (*GitDiffSystem) IdempotentCmdOutput ¶
func (s *GitDiffSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
IdempotentCmdOutput implements System.IdempotentCmdOutput.
func (*GitDiffSystem) Lstat ¶
func (s *GitDiffSystem) Lstat(name AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*GitDiffSystem) Mkdir ¶
func (s *GitDiffSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*GitDiffSystem) RawPath ¶
func (s *GitDiffSystem) RawPath(path AbsPath) (AbsPath, error)
RawPath implements System.RawPath.
func (*GitDiffSystem) ReadDir ¶
func (s *GitDiffSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
ReadDir implements System.ReadDir.
func (*GitDiffSystem) ReadFile ¶
func (s *GitDiffSystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*GitDiffSystem) Readlink ¶
func (s *GitDiffSystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (*GitDiffSystem) RemoveAll ¶
func (s *GitDiffSystem) RemoveAll(name AbsPath) error
RemoveAll implements System.RemoveAll.
func (*GitDiffSystem) Rename ¶
func (s *GitDiffSystem) Rename(oldpath, newpath AbsPath) error
Rename implements System.Rename.
func (*GitDiffSystem) RunCmd ¶
func (s *GitDiffSystem) RunCmd(cmd *exec.Cmd) error
RunCmd implements System.RunCmd.
func (*GitDiffSystem) RunScript ¶
func (s *GitDiffSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (*GitDiffSystem) Stat ¶
func (s *GitDiffSystem) Stat(name AbsPath) (os.FileInfo, error)
Stat implements System.Stat.
func (*GitDiffSystem) UnderlyingFS ¶
func (s *GitDiffSystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (*GitDiffSystem) WriteSymlink ¶
func (s *GitDiffSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
type IncludeBits ¶
type IncludeBits int
An IncludeBits is a bitmask of entries to include.
const ( IncludeAbsent IncludeBits = 1 << iota IncludeDirs IncludeFiles IncludeScripts IncludeSymlinks // IncludeAll is all include bits. IncludeAll IncludeBits = IncludeAbsent | IncludeDirs | IncludeFiles | IncludeScripts | IncludeSymlinks )
Include bits.
type IncludeSet ¶
type IncludeSet struct {
// contains filtered or unexported fields
}
An IncludeSet controls what types of entries to include. It parses and prints as a comma-separated list of strings, but is internally represented as a bitmask. *IncludeSet implements the github.com/spf13/pflag.Value interface.
func NewIncludeSet ¶
func NewIncludeSet(bits IncludeBits) *IncludeSet
NewIncludeSet returns a new IncludeSet.
func (*IncludeSet) IncludeActualStateEntry ¶
func (s *IncludeSet) IncludeActualStateEntry(actualStateEntry ActualStateEntry) bool
IncludeActualStateEntry returns true if actualStateEntry should be included.
func (*IncludeSet) IncludeFileInfo ¶
func (s *IncludeSet) IncludeFileInfo(info os.FileInfo) bool
IncludeFileInfo returns true if info should be included.
func (*IncludeSet) IncludeTargetStateEntry ¶
func (s *IncludeSet) IncludeTargetStateEntry(targetStateEntry TargetStateEntry) bool
IncludeTargetStateEntry returns true if targetStateEntry should be included.
func (*IncludeSet) Set ¶
func (s *IncludeSet) Set(str string) error
Set implements github.com/spf13/pflag.Value.Set.
func (*IncludeSet) String ¶
func (s *IncludeSet) String() string
func (*IncludeSet) Type ¶
func (s *IncludeSet) Type() string
Type implements github.com/spf13/pflag.Value.Type.
type MockPersistentState ¶
type MockPersistentState struct {
// contains filtered or unexported fields
}
A MockPersistentState is a mock persistent state.
func NewMockPersistentState ¶
func NewMockPersistentState() *MockPersistentState
NewMockPersistentState returns a new PersistentState.
func (*MockPersistentState) CopyTo ¶
func (s *MockPersistentState) CopyTo(p PersistentState) error
CopyTo implements PersistentState.CopyTo.
func (*MockPersistentState) Delete ¶
func (s *MockPersistentState) Delete(bucket, key []byte) error
Delete implements PersistentState.Delete.
func (*MockPersistentState) ForEach ¶
func (s *MockPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
ForEach implements PersistentState.ForEach.
func (*MockPersistentState) Get ¶
func (s *MockPersistentState) Get(bucket, key []byte) ([]byte, error)
Get implements PersistentState.Get.
func (*MockPersistentState) Set ¶
func (s *MockPersistentState) Set(bucket, key, value []byte) error
Set implements PersistentState.Set.
type NoEncryption ¶
type NoEncryption struct{}
NoEncryption returns an error when any method is called.
func (NoEncryption) Decrypt ¶
func (NoEncryption) Decrypt([]byte) ([]byte, error)
Decrypt implements Encryption.Decrypt.
func (NoEncryption) DecryptToFile ¶
func (NoEncryption) DecryptToFile(string, []byte) error
DecryptToFile implements Encryption.DecryptToFile.
func (NoEncryption) Encrypt ¶
func (NoEncryption) Encrypt([]byte) ([]byte, error)
Encrypt implements Encryption.Encrypt.
func (NoEncryption) EncryptFile ¶
func (NoEncryption) EncryptFile(string) ([]byte, error)
EncryptFile implements Encryption.EncryptFile.
type NullPersistentState ¶
type NullPersistentState struct{}
A NullPersistentState is an empty PersistentState that returns the zero value for all reads and silently consumes all writes.
func (NullPersistentState) CopyTo ¶
func (NullPersistentState) CopyTo(s PersistentState) error
CopyTo does nothing.
func (NullPersistentState) Delete ¶
func (NullPersistentState) Delete(bucket, key []byte) error
Delete does nothing.
func (NullPersistentState) ForEach ¶
func (NullPersistentState) ForEach(bucket []byte, fn func(k, v []byte) error) error
ForEach does nothing.
func (NullPersistentState) Get ¶
func (NullPersistentState) Get(bucket, key []byte) ([]byte, error)
Get does nothing.
func (NullPersistentState) Set ¶
func (NullPersistentState) Set(bucket, key, value []byte) error
Set does nothing.
type PersistentState ¶
type PersistentState interface { Close() error CopyTo(s PersistentState) error Delete(bucket, key []byte) error ForEach(bucket []byte, fn func(k, v []byte) error) error Get(bucket, key []byte) ([]byte, error) Set(bucket, key, value []byte) error }
A PersistentState is a persistent state.
type PreApplyFunc ¶
type PreApplyFunc func(targetRelPath RelPath, targetEntryState, lastWrittenEntryState, actualEntryState *EntryState) error
A PreApplyFunc is called before a target is applied.
type ReadOnlySystem ¶
type ReadOnlySystem struct {
// contains filtered or unexported fields
}
A ReadOnlySystem is a system that may only be read from.
func NewReadOnlySystem ¶
func NewReadOnlySystem(system System) *ReadOnlySystem
NewReadOnlySystem returns a new ReadOnlySystem that wraps system.
func (*ReadOnlySystem) Glob ¶
func (s *ReadOnlySystem) Glob(pattern string) ([]string, error)
Glob implements System.Glob.
func (*ReadOnlySystem) IdempotentCmdOutput ¶
func (s *ReadOnlySystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
IdempotentCmdOutput implements System.IdempotentCmdOutput.
func (*ReadOnlySystem) Lstat ¶
func (s *ReadOnlySystem) Lstat(filename AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*ReadOnlySystem) RawPath ¶
func (s *ReadOnlySystem) RawPath(path AbsPath) (AbsPath, error)
RawPath implements System.RawPath.
func (*ReadOnlySystem) ReadDir ¶
func (s *ReadOnlySystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
ReadDir implements System.ReadDir.
func (*ReadOnlySystem) ReadFile ¶
func (s *ReadOnlySystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*ReadOnlySystem) Readlink ¶
func (s *ReadOnlySystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (*ReadOnlySystem) Stat ¶
func (s *ReadOnlySystem) Stat(name AbsPath) (os.FileInfo, error)
Stat implements System.Stat.
func (*ReadOnlySystem) UnderlyingFS ¶
func (s *ReadOnlySystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (ReadOnlySystem) WriteSymlink ¶
type RealSystem ¶
type RealSystem struct {
// contains filtered or unexported fields
}
An RealSystem is a System that writes to a filesystem and executes scripts.
func NewRealSystem ¶
func NewRealSystem(fs vfs.FS) *RealSystem
NewRealSystem returns a System that acts on fs.
func (*RealSystem) Chmod ¶
func (s *RealSystem) Chmod(name AbsPath, mode os.FileMode) error
Chmod implements System.Chmod.
func (*RealSystem) Glob ¶
func (s *RealSystem) Glob(pattern string) ([]string, error)
Glob implements System.Glob.
func (*RealSystem) IdempotentCmdOutput ¶
func (s *RealSystem) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error)
IdempotentCmdOutput implements System.IdempotentCmdOutput.
func (*RealSystem) Lstat ¶
func (s *RealSystem) Lstat(filename AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*RealSystem) Mkdir ¶
func (s *RealSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*RealSystem) PathSeparator ¶
func (s *RealSystem) PathSeparator() rune
PathSeparator implements doublestar.OS.PathSeparator.
func (*RealSystem) RawPath ¶
func (s *RealSystem) RawPath(absPath AbsPath) (AbsPath, error)
RawPath implements System.RawPath.
func (*RealSystem) ReadDir ¶
func (s *RealSystem) ReadDir(dirname AbsPath) ([]os.FileInfo, error)
ReadDir implements System.ReadDir.
func (*RealSystem) ReadFile ¶
func (s *RealSystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*RealSystem) Readlink ¶
func (s *RealSystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (*RealSystem) RemoveAll ¶
func (s *RealSystem) RemoveAll(name AbsPath) error
RemoveAll implements System.RemoveAll.
func (*RealSystem) Rename ¶
func (s *RealSystem) Rename(oldpath, newpath AbsPath) error
Rename implements System.Rename.
func (*RealSystem) RunCmd ¶
func (s *RealSystem) RunCmd(cmd *exec.Cmd) error
RunCmd implements System.RunCmd.
func (*RealSystem) RunScript ¶
func (s *RealSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) (err error)
RunScript implements System.RunScript.
func (*RealSystem) Stat ¶
func (s *RealSystem) Stat(name AbsPath) (os.FileInfo, error)
Stat implements System.Stat.
func (*RealSystem) UnderlyingFS ¶
func (s *RealSystem) UnderlyingFS() vfs.FS
UnderlyingFS implements System.UnderlyingFS.
func (*RealSystem) WriteSymlink ¶
func (s *RealSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
type RelPath ¶
type RelPath string
A RelPath is a relative path.
func (RelPath) HasDirPrefix ¶
HasDirPrefix returns true if p has dir prefix dirPrefix.
type RelPaths ¶
type RelPaths []RelPath
RelPaths is a slice of RelPaths that implements sort.Interface.
type SourceFileTargetType ¶
type SourceFileTargetType int
A SourceFileTargetType is a the type of a target represented by a file in the source state. A file in the source state can represent a file, script, or symlink in the target state.
const ( SourceFileTypeFile SourceFileTargetType = iota SourceFileTypePresent SourceFileTypeScript SourceFileTypeSymlink )
Source file types.
type SourceRelPath ¶
type SourceRelPath struct {
// contains filtered or unexported fields
}
A SourceRelPath is a relative path to an entry in the source state.
func NewSourceRelDirPath ¶
func NewSourceRelDirPath(relPath RelPath) SourceRelPath
NewSourceRelDirPath returns a new SourceRelPath for a directory.
func NewSourceRelPath ¶
func NewSourceRelPath(relPath RelPath) SourceRelPath
NewSourceRelPath returns a new SourceRelPath.
func (SourceRelPath) Join ¶
func (p SourceRelPath) Join(elems ...SourceRelPath) SourceRelPath
Join appends elems to p.
func (SourceRelPath) RelPath ¶
func (p SourceRelPath) RelPath() RelPath
RelPath returns p as a relative path.
func (SourceRelPath) Split ¶
func (p SourceRelPath) Split() (SourceRelPath, SourceRelPath)
Split returns the p's file and directory.
func (SourceRelPath) String ¶
func (p SourceRelPath) String() string
func (SourceRelPath) TargetRelPath ¶
func (p SourceRelPath) TargetRelPath() RelPath
TargetRelPath returns the relative path of p's target.
type SourceRelPaths ¶
type SourceRelPaths []SourceRelPath
SourceRelPaths is a slice of SourceRelPaths that implements sort.Interface.
func (SourceRelPaths) Len ¶
func (ps SourceRelPaths) Len() int
func (SourceRelPaths) Less ¶
func (ps SourceRelPaths) Less(i, j int) bool
func (SourceRelPaths) Swap ¶
func (ps SourceRelPaths) Swap(i, j int)
type SourceState ¶
type SourceState struct {
// contains filtered or unexported fields
}
A SourceState is a source state.
func NewSourceState ¶
func NewSourceState(options ...SourceStateOption) *SourceState
NewSourceState creates a new source state with the given options.
func (*SourceState) Add ¶
func (s *SourceState) Add(sourceSystem System, persistentState PersistentState, destSystem System, destAbsPathInfos map[AbsPath]os.FileInfo, options *AddOptions) error
Add adds destAbsPathInfos to s.
func (*SourceState) AddDestAbsPathInfos ¶
func (s *SourceState) AddDestAbsPathInfos(destAbsPathInfos map[AbsPath]os.FileInfo, system System, destAbsPath AbsPath, info os.FileInfo) error
AddDestAbsPathInfos adds an os.FileInfo to destAbsPathInfos for destAbsPath and any of its parents which are not already known.
func (*SourceState) Apply ¶
func (s *SourceState) Apply(targetSystem System, persistentState PersistentState, targetDir AbsPath, targetRelPath RelPath, options ApplyOptions) error
Apply updates targetRelPath in targetDir in targetSystem to match s.
func (*SourceState) Entries ¶
func (s *SourceState) Entries() map[RelPath]SourceStateEntry
Entries returns s's source state entries.
func (*SourceState) Entry ¶
func (s *SourceState) Entry(targetRelPath RelPath) (SourceStateEntry, bool)
Entry returns the source state entry for targetRelPath.
func (*SourceState) ExecuteTemplateData ¶
func (s *SourceState) ExecuteTemplateData(name string, data []byte) ([]byte, error)
ExecuteTemplateData returns the result of executing template data.
func (*SourceState) Ignored ¶
func (s *SourceState) Ignored(targetRelPath RelPath) bool
Ignored returns if targetRelPath is ignored.
func (*SourceState) MinVersion ¶
func (s *SourceState) MinVersion() semver.Version
MinVersion returns the minimum version for which s is valid.
func (*SourceState) MustEntry ¶
func (s *SourceState) MustEntry(targetRelPath RelPath) SourceStateEntry
MustEntry returns the source state entry associated with targetRelPath, and panics if it does not exist.
func (*SourceState) Read ¶
func (s *SourceState) Read() error
Read reads the source state from the source directory.
func (*SourceState) TargetRelPaths ¶
func (s *SourceState) TargetRelPaths() RelPaths
TargetRelPaths returns all of s's target relative paths in order.
func (*SourceState) TemplateData ¶
func (s *SourceState) TemplateData() map[string]interface{}
TemplateData returns s's template data.
type SourceStateDir ¶
type SourceStateDir struct { Attr DirAttr // contains filtered or unexported fields }
A SourceStateDir represents the state of a directory in the source state.
func (*SourceStateDir) Evaluate ¶
func (s *SourceStateDir) Evaluate() error
Evaluate evaluates s and returns any error.
func (*SourceStateDir) SourceRelPath ¶
func (s *SourceStateDir) SourceRelPath() SourceRelPath
SourceRelPath returns s's source relative path.
func (*SourceStateDir) TargetStateEntry ¶
func (s *SourceStateDir) TargetStateEntry() (TargetStateEntry, error)
TargetStateEntry returns s's target state entry.
type SourceStateEntry ¶
type SourceStateEntry interface { Evaluate() error Order() int SourceRelPath() SourceRelPath TargetStateEntry() (TargetStateEntry, error) }
A SourceStateEntry represents the state of an entry in the source state.
type SourceStateFile ¶
type SourceStateFile struct { Attr FileAttr // contains filtered or unexported fields }
A SourceStateFile represents the state of a file in the source state.
func (SourceStateFile) ContentsSHA256 ¶
ContentsSHA256 returns the SHA256 sum of lc's contents.
func (*SourceStateFile) Evaluate ¶
func (s *SourceStateFile) Evaluate() error
Evaluate evaluates s and returns any error.
func (*SourceStateFile) SourceRelPath ¶
func (s *SourceStateFile) SourceRelPath() SourceRelPath
SourceRelPath returns s's source relative path.
func (*SourceStateFile) TargetStateEntry ¶
func (s *SourceStateFile) TargetStateEntry() (TargetStateEntry, error)
TargetStateEntry returns s's target state entry.
type SourceStateOption ¶
type SourceStateOption func(*SourceState)
A SourceStateOption sets an option on a source state.
func WithDefaultTemplateDataFunc ¶
func WithDefaultTemplateDataFunc(defaultTemplateDataFunc func() map[string]interface{}) SourceStateOption
WithDefaultTemplateDataFunc sets the default template data function.
func WithDestDir ¶
func WithDestDir(destDirAbsPath AbsPath) SourceStateOption
WithDestDir sets the destination directory.
func WithEncryption ¶
func WithEncryption(encryption Encryption) SourceStateOption
WithEncryption sets the encryption.
func WithPriorityTemplateData ¶
func WithPriorityTemplateData(priorityTemplateData map[string]interface{}) SourceStateOption
WithPriorityTemplateData adds priority template data.
func WithSourceDir ¶
func WithSourceDir(sourceDirAbsPath AbsPath) SourceStateOption
WithSourceDir sets the source directory.
func WithTemplateFuncs ¶
func WithTemplateFuncs(templateFuncs template.FuncMap) SourceStateOption
WithTemplateFuncs sets the template functions.
func WithTemplateOptions ¶
func WithTemplateOptions(templateOptions []string) SourceStateOption
WithTemplateOptions sets the template options.
type SourceStateRemove ¶
type SourceStateRemove struct {
// contains filtered or unexported fields
}
A SourceStateRemove represents that an entry should be removed.
func (*SourceStateRemove) Evaluate ¶
func (s *SourceStateRemove) Evaluate() error
Evaluate evaluates s and returns any error.
func (*SourceStateRemove) SourceRelPath ¶
func (s *SourceStateRemove) SourceRelPath() SourceRelPath
SourceRelPath returns s's source relative path.
func (*SourceStateRemove) TargetStateEntry ¶
func (s *SourceStateRemove) TargetStateEntry() (TargetStateEntry, error)
TargetStateEntry returns s's target state entry.
type SourceStateRenameDir ¶
type SourceStateRenameDir struct {
// contains filtered or unexported fields
}
A SourceStateRenameDir represents the renaming of a directory in the source state.
func (*SourceStateRenameDir) Evaluate ¶
func (s *SourceStateRenameDir) Evaluate() error
Evaluate evaluates s and returns any error.
func (*SourceStateRenameDir) Order ¶
func (s *SourceStateRenameDir) Order() int
Order returns s's order.
func (*SourceStateRenameDir) SourceRelPath ¶
func (s *SourceStateRenameDir) SourceRelPath() SourceRelPath
SourceRelPath returns s's source relative path.
func (*SourceStateRenameDir) TargetStateEntry ¶
func (s *SourceStateRenameDir) TargetStateEntry() (TargetStateEntry, error)
TargetStateEntry returns s's target state entry.
type System ¶
type System interface { Chmod(name AbsPath, mode os.FileMode) error Glob(pattern string) ([]string, error) IdempotentCmdOutput(cmd *exec.Cmd) ([]byte, error) Lstat(filename AbsPath) (os.FileInfo, error) Mkdir(name AbsPath, perm os.FileMode) error RawPath(absPath AbsPath) (AbsPath, error) ReadDir(dirname AbsPath) ([]os.FileInfo, error) ReadFile(filename AbsPath) ([]byte, error) Readlink(name AbsPath) (string, error) RemoveAll(name AbsPath) error Rename(oldpath, newpath AbsPath) error RunCmd(cmd *exec.Cmd) error RunScript(scriptname RelPath, dir AbsPath, data []byte) error Stat(name AbsPath) (os.FileInfo, error) UnderlyingFS() vfs.FS WriteFile(filename AbsPath, data []byte, perm os.FileMode) error WriteSymlink(oldname string, newname AbsPath) error }
A System reads from and writes to a filesystem, executes idempotent commands, runs scripts, and persists state.
type TARReaderSystem ¶
type TARReaderSystem struct {
// contains filtered or unexported fields
}
A TARReaderSystem a system constructed from reading a TAR archive.
func NewTARReaderSystem ¶
func NewTARReaderSystem(tarReader *tar.Reader, options TARReaderSystemOptions) (*TARReaderSystem, error)
NewTARReaderSystem returns a new TARReaderSystem from tarReader.
func (*TARReaderSystem) FileInfos ¶
func (s *TARReaderSystem) FileInfos() map[AbsPath]os.FileInfo
FileInfos retunrs s's os.FileInfos.
func (TARReaderSystem) IdempotentCmdOutput ¶
func (*TARReaderSystem) Lstat ¶
func (s *TARReaderSystem) Lstat(filename AbsPath) (os.FileInfo, error)
Lstat implements System.Lstat.
func (*TARReaderSystem) ReadFile ¶
func (s *TARReaderSystem) ReadFile(filename AbsPath) ([]byte, error)
ReadFile implements System.ReadFile.
func (*TARReaderSystem) Readlink ¶
func (s *TARReaderSystem) Readlink(name AbsPath) (string, error)
Readlink implements System.Readlink.
func (TARReaderSystem) UnderlyingFS ¶
func (TARReaderSystem) WriteSymlink ¶
type TARReaderSystemOptions ¶
TARReaderSystemOptions are options to NewTARReaderSystem.
type TARWriterSystem ¶
type TARWriterSystem struct {
// contains filtered or unexported fields
}
A TARWriterSystem is a System that writes to a TAR archive.
func NewTARWriterSystem ¶
func NewTARWriterSystem(w io.Writer, headerTemplate tar.Header) *TARWriterSystem
NewTARWriterSystem returns a new TARWriterSystem that writes a TAR file to w.
func (TARWriterSystem) IdempotentCmdOutput ¶
func (*TARWriterSystem) Mkdir ¶
func (s *TARWriterSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*TARWriterSystem) RunScript ¶
func (s *TARWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (TARWriterSystem) UnderlyingFS ¶
func (*TARWriterSystem) WriteSymlink ¶
func (s *TARWriterSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
type TargetStateAbsent ¶
type TargetStateAbsent struct{}
A TargetStateAbsent represents the absence of an entry in the target state.
func (*TargetStateAbsent) Apply ¶
func (t *TargetStateAbsent) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply updates actualStateEntry to match t.
func (*TargetStateAbsent) EntryState ¶
func (t *TargetStateAbsent) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateAbsent) Evaluate ¶
func (t *TargetStateAbsent) Evaluate() error
Evaluate evaluates t.
func (*TargetStateAbsent) SkipApply ¶
func (t *TargetStateAbsent) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStateDir ¶
type TargetStateDir struct {
// contains filtered or unexported fields
}
A TargetStateDir represents the state of a directory in the target state.
func (*TargetStateDir) Apply ¶
func (t *TargetStateDir) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply updates actualStateEntry to match t. It does not recurse.
func (*TargetStateDir) EntryState ¶
func (t *TargetStateDir) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateDir) SkipApply ¶
func (t *TargetStateDir) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStateEntry ¶
type TargetStateEntry interface { Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error EntryState(umask os.FileMode) (*EntryState, error) Evaluate() error SkipApply(persistentState PersistentState) (bool, error) }
A TargetStateEntry represents the state of an entry in the target state.
type TargetStateFile ¶
type TargetStateFile struct {
// contains filtered or unexported fields
}
A TargetStateFile represents the state of a file in the target state.
func (*TargetStateFile) Apply ¶
func (t *TargetStateFile) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply updates actualStateEntry to match t.
func (TargetStateFile) ContentsSHA256 ¶
ContentsSHA256 returns the SHA256 sum of lc's contents.
func (*TargetStateFile) EntryState ¶
func (t *TargetStateFile) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateFile) SkipApply ¶
func (t *TargetStateFile) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStatePresent ¶
type TargetStatePresent struct {
// contains filtered or unexported fields
}
A TargetStatePresent represents the presence of an entry in the target state.
func (*TargetStatePresent) Apply ¶
func (t *TargetStatePresent) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply updates actualStateEntry to match t.
func (TargetStatePresent) ContentsSHA256 ¶
ContentsSHA256 returns the SHA256 sum of lc's contents.
func (*TargetStatePresent) EntryState ¶
func (t *TargetStatePresent) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStatePresent) Evaluate ¶
func (t *TargetStatePresent) Evaluate() error
Evaluate evaluates t.
func (*TargetStatePresent) SkipApply ¶
func (t *TargetStatePresent) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStateRenameDir ¶
type TargetStateRenameDir struct {
// contains filtered or unexported fields
}
A TargetStateRenameDir represents the renaming of a directory in the target state.
func (*TargetStateRenameDir) Apply ¶
func (t *TargetStateRenameDir) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply renames actualStateEntry.
func (*TargetStateRenameDir) EntryState ¶
func (t *TargetStateRenameDir) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateRenameDir) Evaluate ¶
func (t *TargetStateRenameDir) Evaluate() error
Evaluate does nothing.
func (*TargetStateRenameDir) SkipApply ¶
func (t *TargetStateRenameDir) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStateScript ¶
type TargetStateScript struct {
// contains filtered or unexported fields
}
A TargetStateScript represents the state of a script.
func (*TargetStateScript) Apply ¶
func (t *TargetStateScript) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply runs t.
func (TargetStateScript) ContentsSHA256 ¶
ContentsSHA256 returns the SHA256 sum of lc's contents.
func (*TargetStateScript) EntryState ¶
func (t *TargetStateScript) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateScript) Evaluate ¶
func (t *TargetStateScript) Evaluate() error
Evaluate evaluates t.
func (*TargetStateScript) SkipApply ¶
func (t *TargetStateScript) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type TargetStateSymlink ¶
type TargetStateSymlink struct {
// contains filtered or unexported fields
}
A TargetStateSymlink represents the state of a symlink in the target state.
func (*TargetStateSymlink) Apply ¶
func (t *TargetStateSymlink) Apply(system System, persistentState PersistentState, actualStateEntry ActualStateEntry, umask os.FileMode) error
Apply updates actualStateEntry to match t.
func (*TargetStateSymlink) EntryState ¶
func (t *TargetStateSymlink) EntryState(umask os.FileMode) (*EntryState, error)
EntryState returns t's entry state.
func (*TargetStateSymlink) Evaluate ¶
func (t *TargetStateSymlink) Evaluate() error
Evaluate evaluates t.
func (TargetStateSymlink) LinknameSHA256 ¶
LinknameSHA256 returns the SHA256 sum of ll's linkname.
func (*TargetStateSymlink) SkipApply ¶
func (t *TargetStateSymlink) SkipApply(persistentState PersistentState) (bool, error)
SkipApply implements TargetState.SkipApply.
type ZIPWriterSystem ¶
type ZIPWriterSystem struct {
// contains filtered or unexported fields
}
A ZIPWriterSystem is a System that writes to a ZIP archive.
func NewZIPWriterSystem ¶
func NewZIPWriterSystem(w io.Writer, modified time.Time) *ZIPWriterSystem
NewZIPWriterSystem returns a new ZIPWriterSystem that writes a ZIP archive to w.
func (ZIPWriterSystem) IdempotentCmdOutput ¶
func (*ZIPWriterSystem) Mkdir ¶
func (s *ZIPWriterSystem) Mkdir(name AbsPath, perm os.FileMode) error
Mkdir implements System.Mkdir.
func (*ZIPWriterSystem) RunScript ¶
func (s *ZIPWriterSystem) RunScript(scriptname RelPath, dir AbsPath, data []byte) error
RunScript implements System.RunScript.
func (ZIPWriterSystem) UnderlyingFS ¶
func (*ZIPWriterSystem) WriteSymlink ¶
func (s *ZIPWriterSystem) WriteSymlink(oldname string, newname AbsPath) error
WriteSymlink implements System.WriteSymlink.
Source Files ¶
- actualstateentry.go
- ageencryption.go
- attr.go
- autotemplate.go
- boltpersistentstate.go
- chezmoi.go
- chezmoi_unix.go
- data_linux.go
- debugencryption.go
- debugpersistentstate.go
- debugsystem.go
- diff.go
- doublestaros.go
- dryrunsystem.go
- dumpsystem.go
- encryption.go
- entrystate.go
- format.go
- gitdiffsystem.go
- gpgencryption.go
- hexbytes.go
- includeset.go
- lazy.go
- maybeshellquote.go
- mockpersistentstate.go
- noencryption.go
- nullpersistentstate.go
- path.go
- path_unix.go
- patternset.go
- persistentstate.go
- readonlysystem.go
- realsystem.go
- realsystem_unix.go
- recursivemerge.go
- sourcerelpath.go
- sourcestate.go
- sourcestateentry.go
- system.go
- targetstateentry.go
- tarreadersystem.go
- tarwritersystem.go
- zipwritersystem.go