Documentation
¶
Index ¶
- Constants
- func CacheDir() string
- func FetchPath(path string) (string, error)
- func FetchPaths(pathp string) ([]string, error)
- func Path(p, root string) (string, error)
- func ReadFile(p string) ([]byte, error)
- func RemoveCacheDir() error
- func SetCacheDir(dir string) error
- func SetGlobalCacheDir(dir string)
- func ShortenPath(p string) string
- func SplitKeyAndPath(kp string) (string, string)
Constants ¶
View Source
const ( SchemeHttps = "https" SchemeGitHub = "github" SchemeGist = "gist" SchemeFile = "file" )
View Source
const ( PrefixHttps = SchemeHttps + "://" PrefixGitHub = SchemeGitHub + "://" PrefixGist = SchemeGist + "://" PrefixFile = SchemeFile + "://" )
Variables ¶
This section is empty.
Functions ¶
func FetchPaths ¶
FetchPaths retrieves readable file paths from path list ( like `path/to/a.yml;path/to/b/**/*.yml` ) . If the file paths are remote files, it fetches them and returns their local cache paths.
func ReadFile ¶
ReadFile reads single file from local or cache. When retrieving a cache file, if the cache file does not exist, re-fetch it.
func RemoveCacheDir ¶
func RemoveCacheDir() error
RemoveCacheDir remove cache directory for remote runbooks.
func SetCacheDir ¶
SetCacheDir set cache directory for remote runbooks.
func SetGlobalCacheDir ¶
func SetGlobalCacheDir(dir string)
SetGlobalCacheDir sets the global cache directory directly (for testing).
func SplitKeyAndPath ¶
SplitKeyAndPath splits key and path.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.