Documentation ¶
Index ¶
- func AppendEnvironmentFile(filePath string, kv []KeyValuePair, perm os.FileMode) (bool, error)
- func EnsureDirectory(dirPath string, perm os.FileMode) error
- func EnsureDirectoryOf(filePath string, perm os.FileMode) error
- func UpdateFile(log *logging.Logger, filePath string, content []byte, perm os.FileMode) (bool, error)
- func WeaveNameFromMachineID(machineID string) (string, error)
- type KeyValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendEnvironmentFile ¶
AppendEnvironmentFile ensures that all given key-value pairs are up to date in the given file. If the file does not exist, it is created. Returns: true if the file is created or updated, false otherwise.
func EnsureDirectory ¶
EnsureDirectory checks if a directory with given path exists and if not creates it. If such a path does exist, it checks if it is a directory, if not an error is returned.
func EnsureDirectoryOf ¶
EnsureDirectoryOf checks if the directory of the given file path exists and if not creates it. If such a path does exist, it checks if it is a directory, if not an error is returned.
func UpdateFile ¶
func UpdateFile(log *logging.Logger, filePath string, content []byte, perm os.FileMode) (bool, error)
UpdateFile compares the given content with the context of the file at the given filePath and if the content is different, the file is updated. If the file does not exist, it is created. Returns: true if the file is created or updated, false otherwise.
func WeaveNameFromMachineID ¶
WeaveNameFromMachineID converts a machine ID into a weave peer name.