storage

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CharHidden = "."

Variables

This section is empty.

Functions

func Create

func Create(path string, filename string) error

Create creates a new file at the specified path, including parent directories if needed. Returns error if file creation fails.

func Delete

func Delete(path string, filename string) error

Delete removes the specified file. Returns error if deletion fails.

func Exists

func Exists(path string, filename string) bool

Exists checks if a file exists at the given path and is not a directory. Returns boolean indicating existence.

func Get

func Get(path string, filename string) (string, error)

Get reads and returns the contents of a file as a string. Returns error if file cannot be read.

func GetAppDir

func GetAppDir() string

GetAppDir get dir application

func GetDirectionAndFilename

func GetDirectionAndFilename(fullPath string) (string, string)

GetDirectionAndFilename get dir and filename from full path

func GetFullPath

func GetFullPath(direction string, filename string) string

GetFullPath get full path from dir and filename

func GetOpenFile

func GetOpenFile(path string, filename string, flags int) (*os.File, error)

GetOpenFile opens a file with specified flags (os.O_RDWR, etc.) and returns the file handle. Returns error if file cannot be opened.

func GetPrivateKeysDir

func GetPrivateKeysDir() string

GetPrivateKeysDir get dir where save private keys

func Write

func Write(path string, filename string, data string) error

Write saves data to a file, overwriting existing content. Creates file if it doesn't exist. Returns error on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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