Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoCacheDir = status.New(status.FileAccessError, `Executable cache directory not available.
Make sure binaries can be executed from $HOME/.chef-automate/executable-cache
or set CHEF_AUTOMATE_HOME to a suitable directory.`)
ErrNoCacheDir is returned if a suitable cache directory was not found
Functions ¶
This section is empty.
Types ¶
type ExecutableCache ¶
type ExecutableCache interface { // Store stores the data given as an executable. It can be retrieved // using version as the key. Store(version string, data []byte) (*exec.Cmd, error) // Exists returns true if the given executable exists Exists(version string) (bool, error) // AsCmd returns the command for the executable version. The caller // is responsible for checking if it exists before making this call AsCmd(version string) *exec.Cmd // Latest returns the latest version available Latest() (*exec.Cmd, string) }
ExecutableCache represents something that can cache chef-automate executables
type Opt ¶
type Opt func(*executableCache)
Opt are functional options for executableCache
func WithCacheDir ¶
WithCacheDir sets the cache directory for the executable cache This function is used by the tests. It is up to the caller to make sure that the directory exists before calling Store
Click to show internal directories.
Click to hide internal directories.