Versions in this module Expand all Collapse all v1 v1.2.5 Sep 15, 2025 v1.2.4 Sep 15, 2025 Changes in this version + const FILE + const FTP + const FTPS + const HTTP + const HTTPS + const S3 + const SFTP + var AppFs = afero.NewOsFs() + func CopyFile(fs afero.Fs, path string, newPath string) (int64, error) + func CopyFileP(fs afero.Fs, path string, newPath string) int64 + func CreateLockFile(fs afero.Fs, filename string) (afero.File, error) + func DefaultEtcHosts() (string, error) + func DefaultEtcHostsP() string + func DirExists(fs afero.Fs, path string) (bool, error) + func DirExistsP(fs afero.Fs, path string) bool + func DownloadBytes(logger comm.Logger, fallbackDir string, fs afero.Fs, url string, ...) (result []byte, err error) + func DownloadBytesP(logger comm.Logger, fallbackDir string, fs afero.Fs, url string, ...) []byte + func DownloadText(logger comm.Logger, fallbackDir string, fs afero.Fs, url string, ...) (string, error) + func DownloadTextP(logger comm.Logger, fallbackDir string, fs afero.Fs, url string, ...) string + func EnsureDirExists(fs afero.Fs, path string) error + func EnsureDirExistsP(fs afero.Fs, path string) + func EnsureFileExists(fs afero.Fs, path string) error + func EnsureFileExistsP(fs afero.Fs, path string) + func ExpandHomePath(path string) (string, error) + func ExpandHomePathP(path string) string + func ExtractTitle(filePath string) string + func FallbackFilePath(fallbackDir string, url string) string + func FileExists(fs afero.Fs, path string) (bool, error) + func FileExistsP(fs afero.Fs, path string) bool + func FromYaml(yamlText string, envsubt bool, result any) (err error) + func FromYamlFile(fs afero.Fs, path string, envsubt bool, result any) error + func FromYamlFileP(fs afero.Fs, path string, envsubt bool, result any) + func FromYamlP(yamlText string, envsubt bool, result any) + func GetLockFilePid(fs afero.Fs, filename string) (pid int, err error) + func HasFallbackFile(fallbackDir string, fs afero.Fs, url string) (bool, error) + func IsFileProtocol(url string) bool + func IsRemote(url string) bool + func ListSuffixed(fs afero.Fs, targetDir string, suffix string, skipEmptyFile bool) (map[string]string, error) + func ListSuffixedP(fs afero.Fs, targetDir string, suffix string, skipEmptyFile bool) map[string]string + func MapFromYaml(yamlText string, envsubt bool) (map[string]any, error) + func MapFromYamlFile(fs afero.Fs, path string, envsubt bool) (map[string]any, error) + func MapFromYamlFileP(fs afero.Fs, path string, envsubt bool) map[string]any + func MapFromYamlP(yamlText string, envsubt bool) map[string]any + func Mkdir(fs afero.Fs, path string) error + func MkdirP(fs afero.Fs, path string) + func ReadBytes(fs afero.Fs, path string) ([]byte, error) + func ReadBytesP(fs afero.Fs, path string) []byte + func ReadFallbackFile(fallbackDir string, fs afero.Fs, url string) (string, []byte, error) + func ReadLines(fs afero.Fs, path string) ([]string, error) + func ReadLinesP(fs afero.Fs, path string) []string + func ReadText(fs afero.Fs, path string) (string, error) + func ReadTextP(fs afero.Fs, path string) string + func RemoveDir(fs afero.Fs, path string) error + func RemoveDirP(fs afero.Fs, path string) + func RemoveFile(fs afero.Fs, path string) error + func RemoveFileP(fs afero.Fs, path string) + func Rename(fs afero.Fs, path string, newPath string) error + func RenameP(fs afero.Fs, path string, newPath string) + func ShortDescription(url string) string + func Stat(fs afero.Fs, path string, ensureExists bool) (os.FileInfo, error) + func StatP(fs afero.Fs, path string, ensureExists bool) os.FileInfo + func TempFile(fs afero.Fs, pattern string) (string, error) + func TempFileP(fs afero.Fs, pattern string) string + func TempTextFile(fs afero.Fs, pattern string, content string) (string, error) + func TempTextFileP(fs afero.Fs, pattern string, content string) string + func UserHomeDir() (string, error) + func UserHomeDirP() string + func WorkDir(url string, defaultDir string) string + func Write(fs afero.Fs, path string, content []byte) error + func WriteFallbackFile(fallbackDir string, fs afero.Fs, url string, bytes []byte) (string, error) + func WriteIfNotFound(fs afero.Fs, path string, content []byte) (bool, error) + func WriteIfNotFoundP(fs afero.Fs, path string, content []byte) bool + func WriteLines(fs afero.Fs, path string, lines ...string) error + func WriteLinesP(fs afero.Fs, path string, lines ...string) + func WriteP(fs afero.Fs, path string, content []byte) + func WriteText(fs afero.Fs, path string, content string) error + func WriteTextIfNotFound(fs afero.Fs, path string, content string) (bool, error) + func WriteTextIfNotFoundP(fs afero.Fs, path string, content string) bool + func WriteTextP(fs afero.Fs, path string, content string) + type AferoBlob = *AferoBlobT + func NewAferoBlob(afs afero.Fs, path string) AferoBlob + func (me AferoBlob) Close() error + func (me AferoBlob) Fs() afero.Fs + func (me AferoBlob) Path() string + func (me AferoBlob) Read(p []byte) (n int, err error) + type AferoBlobT struct + type AferoFile = *AferoFileT + func NewAferoFile(afs afero.Fs, apath string, credentials Credentials, timeout time.Duration) (AferoFile, error) + func NewAferoFileP(afs afero.Fs, apath string, credentials Credentials, timeout time.Duration) AferoFile + func (me AferoFile) Credentials() Credentials + func (me AferoFile) Dir() string + func (me AferoFile) Download() (Content, error) + func (me AferoFile) DownloadP() Content + func (me AferoFile) Fs() afero.Fs + func (me AferoFile) Name() string + func (me AferoFile) Protocol() string + func (me AferoFile) Timeout() time.Duration + func (me AferoFile) URL() *url.URL + func (me AferoFile) Url() string + type AferoFileT struct + type Content = *ContentT + type ContentT = models.RemoteFileContent + type Credentials = *CredentialsT + type CredentialsT = models.Credentials + type File interface + Credentials func() Credentials + Dir func() string + Download func() (Content, error) + DownloadP func() Content + Name func() string + Protocol func() string + Timeout func() time.Duration + URL func() *url.URL + Url func() string + func NewFile(afs afero.Fs, url string, credentials Credentials, timeout time.Duration) (File, error) + func NewFileP(afs afero.Fs, url string, credentials Credentials, timeout time.Duration) File + type RemoteFile = *RemoteFileT + func NewRemoteFile(url string, credentials Credentials, timeout time.Duration) (RemoteFile, error) + func NewRemoteFileP(url string, credentials Credentials, timeout time.Duration) RemoteFile + func (me RemoteFile) Credentials() Credentials + func (me RemoteFile) Dir() string + func (me RemoteFile) Download() (Content, error) + func (me RemoteFile) DownloadP() Content + func (me RemoteFile) Name() string + func (me RemoteFile) Protocol() string + func (me RemoteFile) Timeout() time.Duration + func (me RemoteFile) URL() *url.URL + func (me RemoteFile) Url() string + type RemoteFileT struct