Documentation
¶
Index ¶
- Constants
- Variables
- func CopyFile(fs afero.Fs, path string, newPath string) int64
- func CreateLockFile(fs afero.Fs, filename string) (afero.File, error)
- func DefaultEtcHosts() string
- func DirExists(fs afero.Fs, path string) bool
- func DownloadBytes(fs afero.Fs, url string, credentials Credentials, timeout time.Duration) []byte
- func DownloadText(fs afero.Fs, url string, credentials Credentials, timeout time.Duration) string
- func EnsureDirExists(fs afero.Fs, path string)
- func EnsureFileExists(fs afero.Fs, path string)
- func ExpandHomePath(path string) string
- func ExtractTitle(filePath string) string
- func FileExists(fs afero.Fs, path string) bool
- func FromYamlFile(fs afero.Fs, path string, envsubt bool, result any)
- func GetLockFilePid(fs afero.Fs, filename string) (pid int, err 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
- func MapFromYamlFile(fs afero.Fs, path string, envsubt bool) map[string]any
- func Mkdir(fs afero.Fs, path string)
- func ReadBytes(fs afero.Fs, path string) []byte
- func ReadLines(fs afero.Fs, path string) []string
- func ReadText(fs afero.Fs, path string) string
- func RemoveDir(fs afero.Fs, path string)
- func RemoveFile(fs afero.Fs, path string)
- func Rename(fs afero.Fs, path string, newPath string)
- func ShortDescription(url string) string
- func Stat(fs afero.Fs, path string, ensureExists bool) os.FileInfo
- func TempFile(fs afero.Fs, pattern string) string
- func TempTextFile(fs afero.Fs, pattern string, content string) string
- func UserHomeDir() string
- func WorkDir(url string, defaultDir string) string
- func Write(fs afero.Fs, path string, content []byte)
- func WriteIfNotFound(fs afero.Fs, path string, content []byte) bool
- func WriteLines(fs afero.Fs, path string, lines ...string)
- func WriteLinesIfNotFound(fs afero.Fs, path string, lines ...string) bool
- func WriteText(fs afero.Fs, path string, content string)
- func WriteTextIfNotFound(fs afero.Fs, path string, content string) bool
- type AferoBlob
- type AferoBlobT
- type AferoFile
- func (me AferoFile) Credentials() Credentials
- func (me AferoFile) Dir() string
- func (me AferoFile) Download() 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
- 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 RemoteFileContent
- type RemoteFileContentT
- 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 DefaultEtcHosts() string
func DownloadBytes ¶
func DownloadText ¶
func EnsureDirExists ¶
func EnsureFileExists ¶
func ExtractTitle ¶
func GetLockFilePid ¶ added in v1.0.2
If filename is a lock file, returns the PID of the process locking it
func IsFileProtocol ¶
func ListSuffixed ¶
func ShortDescription ¶
func UserHomeDir ¶
func UserHomeDir() string
func WriteIfNotFound ¶
WriteIfNotFound ...
func WriteLinesIfNotFound ¶
WriteLinesIfNotFound ...
Types ¶
type AferoBlob ¶
type AferoBlob = *AferoBlobT
type AferoBlobT ¶
type AferoBlobT struct {
// contains filtered or unexported fields
}
type AferoFile ¶
type AferoFile = *AferoFileT
func NewAferoFile ¶
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 RemoteFile ¶
type RemoteFile = *RemoteFileT
func NewRemoteFile ¶
func NewRemoteFile(url string, credentials Credentials, timeout time.Duration) RemoteFile
func (RemoteFile) Credentials ¶
func (me RemoteFile) Credentials() Credentials
func (RemoteFile) Download ¶
func (me RemoteFile) Download() 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 RemoteFileContent ¶
type RemoteFileContent = *RemoteFileContentT
type RemoteFileContentT ¶
type RemoteFileContentT struct {
// contains filtered or unexported fields
}
type RemoteFileT ¶
type RemoteFileT struct {
// contains filtered or unexported fields
}
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.