Documentation ¶
Index ¶
- Constants
- Variables
- 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
- type AferoBlobT
- type 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
- type Content
- type ContentT
- type Credentials
- type CredentialsT
- type File
- type 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
Constants ¶
Variables ¶
View Source
var AppFs = afero.NewOsFs()
Functions ¶
func CreateLockFile ¶ added in v1.0.2
CreateLockFile tries to create a file with given name and acquire an exclusive lock on it. If the file already exists AND is still locked, it will fail.
func DefaultEtcHosts ¶
func DefaultEtcHostsP ¶ added in v1.1.0
func DefaultEtcHostsP() string
func DownloadBytes ¶
func DownloadBytesP ¶ added in v1.1.0
func DownloadText ¶
func DownloadTextP ¶ added in v1.1.0
func EnsureDirExistsP ¶ added in v1.1.0
func EnsureFileExistsP ¶ added in v1.1.0
func ExpandHomePathP ¶ added in v1.1.0
func ExtractTitle ¶
func FallbackFilePath ¶ added in v1.2.1
func FromYamlFileP ¶ added in v1.1.0
func GetLockFilePid ¶ added in v1.0.2
If filename is a lock file, returns the PID of the process locking it
func HasFallbackFile ¶ added in v1.2.1
func IsFileProtocol ¶
func ListSuffixed ¶
func ListSuffixedP ¶ added in v1.1.0
func MapFromYaml ¶ added in v1.2.3
func MapFromYamlFile ¶
func MapFromYamlFileP ¶ added in v1.1.0
func ReadFallbackFile ¶ added in v1.2.1
func RemoveDirP ¶ added in v1.1.0
func RemoveFileP ¶ added in v1.1.0
func ShortDescription ¶
func TempTextFileP ¶ added in v1.1.0
func UserHomeDir ¶
func UserHomeDirP ¶ added in v1.1.0
func UserHomeDirP() string
func WriteFallbackFile ¶ added in v1.2.1
func WriteIfNotFound ¶
WriteIfNotFound ...
func WriteIfNotFoundP ¶ added in v1.1.0
func WriteLinesP ¶ added in v1.1.0
WriteLines ...
func WriteTextIfNotFound ¶
func WriteTextIfNotFoundP ¶ added in v1.1.0
WriteTextIfNotFound ...
Types ¶
type AferoBlob ¶
type AferoBlob = *AferoBlobT
type AferoBlobT ¶
type AferoBlobT struct {
// contains filtered or unexported fields
}
type AferoFile ¶
type AferoFile = *AferoFileT
func NewAferoFile ¶
func NewAferoFileP ¶ added in v1.1.0
func (AferoFile) Credentials ¶
func (me AferoFile) Credentials() Credentials
type AferoFileT ¶
type AferoFileT struct {
// contains filtered or unexported fields
}
type ContentT ¶
type ContentT = models.RemoteFileContent
type Credentials ¶
type Credentials = *CredentialsT
type CredentialsT ¶
type CredentialsT = models.Credentials
type File ¶
type File interface { Name() string Dir() string Url() string Protocol() string URL() *url.URL Credentials() Credentials Timeout() time.Duration DownloadP() Content Download() (Content, error) }
type RemoteFile ¶
type RemoteFile = *RemoteFileT
func NewRemoteFile ¶
func NewRemoteFile(url string, credentials Credentials, timeout time.Duration) (RemoteFile, error)
func NewRemoteFileP ¶ added in v1.1.0
func NewRemoteFileP(url string, credentials Credentials, timeout time.Duration) RemoteFile
func (RemoteFile) Credentials ¶
func (me RemoteFile) Credentials() Credentials
func (RemoteFile) Download ¶
func (me RemoteFile) Download() (Content, error)
func (RemoteFile) DownloadP ¶ added in v1.1.0
func (me RemoteFile) DownloadP() Content
func (RemoteFile) Name ¶
func (me RemoteFile) Name() string
func (RemoteFile) Protocol ¶
func (me RemoteFile) Protocol() string
remote protocol. May be used to explicitly tell what protocol to use (i.e. "http", "ftp", "etc").
func (RemoteFile) Timeout ¶
func (me RemoteFile) Timeout() time.Duration
func (RemoteFile) URL ¶
func (me RemoteFile) URL() *url.URL
type RemoteFileT ¶
type RemoteFileT struct {
// contains filtered or unexported fields
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
patch
|
|
go-universal-network-adapter
Package contains realization of class for file download via HTTP protocol
|
Package contains realization of class for file download via HTTP protocol |
Click to show internal directories.
Click to hide internal directories.