files

package
v0.6.299 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppFs = afero.NewOsFs()

Functions

func BuildBrevHome added in v0.6.24

func BuildBrevHome(fs afero.Fs, userHome string) error

func CatFile added in v0.6.44

func CatFile(filePath string) (string, error)

func DeleteFile

func DeleteFile(fs afero.Fs, filepath string) error

Delete a single file altogether.

func GetActiveOrgsPath

func GetActiveOrgsPath(home string) string

func GetBrevCloudflaredBinaryPath added in v0.6.295

func GetBrevCloudflaredBinaryPath(home string) string

func GetBrevHome added in v0.6.0

func GetBrevHome(userHome string) string

func GetBrevSSHConfigPath added in v0.6.0

func GetBrevSSHConfigPath(home string) string

func GetNewBackupSSHConfigFileName added in v0.2.0

func GetNewBackupSSHConfigFileName() string

func GetNewBackupSSHConfigFilePath added in v0.2.0

func GetNewBackupSSHConfigFilePath(home string) string

func GetOnboardingStepPath added in v0.6.91

func GetOnboardingStepPath(home string) string

func GetSSHPrivateKeyFileName

func GetSSHPrivateKeyFileName() string

func GetSSHPrivateKeyPath added in v0.6.0

func GetSSHPrivateKeyPath(home string) string

func GetUserSSHConfigPath added in v0.2.0

func GetUserSSHConfigPath(home string) (string, error)

func OverwriteJSON

func OverwriteJSON(fs afero.Fs, filepath string, v interface{}) error

OverwriteJSON data in the target file with data from the given struct

Usage (unstructured):

  OverwriteJSON("tmp/a/b/c.json", map[string]string{
	    "hi": "there",
  })

Usage (struct):

var foo myStruct
OverwriteJSON("tmp/a/b/c.json", foo)

func ReadJSON

func ReadJSON(fs afero.Fs, unsafeFilePathString string, v interface{}) error

ReadJSON reads data from a file into the given struct

Usage:

var foo myStruct
files.ReadJSON("tmp/a.json", &foo)

func ReadString

func ReadString(fs afero.Fs, unsafeFilePathString string) (string, error)

func WriteSSHPrivateKey

func WriteSSHPrivateKey(fs afero.Fs, data string, home string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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