fs

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 CacheDir

func CacheDir() string

CacheDir returns the current cache directory.

func FetchPath

func FetchPath(path string) (string, error)

FetchPath retrieves readable file path.

func FetchPaths

func FetchPaths(pathp string) ([]string, error)

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 Path

func Path(p, root string) (string, error)

Path returns the absolute path of root+p. If path is a remote file, Fp returns p.

func ReadFile

func ReadFile(p string) ([]byte, error)

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

func SetCacheDir(dir string) error

SetCacheDir set cache directory for remote runbooks.

func SetGlobalCacheDir

func SetGlobalCacheDir(dir string)

SetGlobalCacheDir sets the global cache directory directly (for testing).

func ShortenPath

func ShortenPath(p string) string

ShortenPath shorten path.

func SplitKeyAndPath

func SplitKeyAndPath(kp string) (string, string)

SplitKeyAndPath splits key and path.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL