Documentation
¶
Index ¶
- func CreateFile(filePath string) (*os.File, *errors.Error)
- func FileExists(filePath string) bool
- func OpenFile(filePath string) (*os.File, *errors.Error)
- func ReadFile(filePath string) ([]byte, *errors.Error)
- func ReadJsonFile(filePath string, out any) *errors.Error
- func RemoveFile(filePath string) *errors.Error
- func WriteFile(filePath string, data []byte) *errors.Error
- func WriteJSONFile(filePath string, in any) *errors.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
CreateFile creates a new file The method returns an errors if there was an issue with creating an new file
func FileExists ¶
FileExists checks if a file exists and returns an errors if the file was not found
func OpenFile ¶
OpenFile opens a file The method returns an errors if there is an issue with opening the file
func ReadFile ¶
ReadFile checks if a file exists and if it does tries to reads the contents of the file and returns the data back The method returns an errors the file does not exist or if there was an errors in reading the contents of the file
func ReadJsonFile ¶
ReadJsonFile reads a yaml file and puts the contents into the out variables out variable should be a pointer to a valid struct The method returns and errors if reading a file or the unmarshal process fails
func RemoveFile ¶
RemoveFile removes files from the provided valid filePath.
func WriteFile ¶
WriteFile creates a new file if the file does not exists and writes data into the file The method returns an errors if there was an issue creating a new file or while writing data into the file
func WriteJSONFile ¶
WriteJSONFile encodes the data from an input interface into json format and writes the data into a file The in interface should be an address to a valid struct The method returns an errors if there is an errors with the json encode or with writing to the file
Types ¶
This section is empty.