package
0.19.5
Repository: https://github.com/safing/portbase.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
Package renameio provides a way to atomically create or replace a file or symbolic link.

# Functions

CopyFileAtomic is like CreateAtomic but copies content from src to dest.
CreateAtomic creates or overwrites a file at dest atomically using data from r.
DerivedInstanceUUID returns a new UUID that is derived from the input, but is unique per instance (execution) and therefore is only reproducible with the same process.
DerivedUUID returns a new UUID that is derived from the input only, and therefore is always reproducible.
DuplicateBytes returns a new copy of the given byte slice.
DuplicateStrings returns a new copy of the given string slice.
EnsureDirectory ensures that the given directory exists and that is has the given permissions set.
IndexOfString returns the index of given string and -1 if its not part of the slice.
MimeTypeByExtension returns a mimetype for the given file name extension, which must including the leading dot.
NewBroadcastFlag returns a new BroadcastFlag.
NewCallLimiter returns a new call limiter.
NewDirStructure returns a new DirStructure.
PathExists returns whether the given path (file or dir) exists.
RandomUUID returns a new random UUID with optionally provided ns.
RemoveFromStringSlice removes the given string from the slice and returns a new slice.
ReplaceFileAtomic replaces the file at dest with the content from src.
SafeFirst16Bytes return the first 16 bytes of the given data in safe form.
SafeFirst16Chars return the first 16 characters of the given data in safe form.
StringInSlice returns whether the given string is in the string slice.
StringSliceEqual returns whether the given string slices are equal.

# Structs

AtomicFileOptions holds additional options for manipulating the behavior of CreateAtomic and friends.
BroadcastFlag is a simple system to broadcast a flag value.
CallLimiter bundles concurrent calls and optionally limits how fast a function is called.
DirStructure represents a directory structure with permissions that should be enforced.
Flag receives changes from its broadcasting flag.
OnceAgain is an object that will perform only one action "in flight".
A StablePool is a drop-in replacement for sync.Pool that is slower, but predictable.