Documentation
¶
Overview ¶
Package symlinkopts provides an efficient interface to create unambiguous symlink options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options represents a set of options for handling symlinks. The zero value is equivalent to skipping all symlinks.
func PreserveAllowDangling ¶
func PreserveAllowDangling() Options
PreserveAllowDangling returns the correct set of options to preserve all symlinks without targets.
Targets need to be explicitly included. Dangling links are allowed.
func PreserveNoDangling ¶
func PreserveNoDangling() Options
PreserveNoDangling returns the correct set of options to preserve all symlinks without targets.
Targets need to be explicitly included. Dangling links are not allowed.
func PreserveWithTarget ¶
func PreserveWithTarget() Options
PreserveWithTarget returns the correct set of options to preserve all symlinks and include the targets.
This implies that dangling links are not allowed.
func ResolveAlways ¶
func ResolveAlways() Options
ResolveAlways return the correct set of options to always resolve symlinks.
This implies that symlinks are followed and no dangling symlinks are allowed. Every symlink will be replaced by its target. For example, if foo/bar was a symlink to the regular file baz, then foo/bar will become a regular file with the content of baz.
func ResolveExternalOnly ¶
func ResolveExternalOnly() Options
ResolveExternalOnly returns the correct set of options to only resolve symlinks if the target is outside the root directory. Otherwise, the symlink is preserved.
This implies that all symlinks are followed, therefore, no dangling links are allowed. Otherwise, it's not possible to guarantee that all required files are under the root. Targets of non-external symlinks are not included.
func ResolveExternalOnlyWithTarget ¶
func ResolveExternalOnlyWithTarget() Options
ResolveExternalOnlyWithTarget is like ResolveExternalOnly but targets of non-external symlinks are included.
func Skip ¶
func Skip() Options
Skip is the zero value for Options which is equivalent to skipping all symlinks (as if they did not exist).
func (Options) IncludeTarget ¶
IncludeTarget returns true if the options include the corresponding property.
func (Options) NoDangling ¶
NoDangling returns true if the options include the corresponding property.
func (Options) ResolveExternal ¶
ResolveExternal returns true if the options include the corresponding property.