files

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(filepath string) error

Delete a single file altogether.

func Exists

func Exists(filepath string, isDir bool) (bool, error)

func GetActiveOrgFile

func GetActiveOrgFile() string

func GetActiveOrgsPath

func GetActiveOrgsPath() string

func GetBrevDirectory

func GetBrevDirectory() string

func GetCertFilePath

func GetCertFilePath() string

func GetHomeDir

func GetHomeDir() string

func GetKubeCertFileName

func GetKubeCertFileName() string

func GetOrgCacheFile

func GetOrgCacheFile() string

func GetOrgCacheFilePath

func GetOrgCacheFilePath() string

func GetSSHPrivateKeyFileName

func GetSSHPrivateKeyFileName() string

func GetSSHPrivateKeyFilePath

func GetSSHPrivateKeyFilePath() string

func GetWorkspaceCacheFile

func GetWorkspaceCacheFile() string

func GetWorkspacesCacheFilePath

func GetWorkspacesCacheFilePath() string

func OverwriteJSON

func OverwriteJSON(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 OverwriteString

func OverwriteString(filepath string, data string) error

OverwriteString data in the target file with data from the given string

Usage

OverwriteString("tmp/a/b/c.txt", "hi there")

func ReadJSON

func ReadJSON(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(unsafeFilePathString string) (string, error)

func WriteSSHPrivateKey

func WriteSSHPrivateKey(data string) error

OverwriteString data in the target file with data from the given string

Usage

OverwriteString("tmp/a/b/c.txt", "hi there")

Types

This section is empty.

Jump to

Keyboard shortcuts

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