config

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Filename      = envconst.FilenameConfig
	FileFlagWrite = os.O_WRONLY | os.O_APPEND | os.O_CREATE
	FileFlagRead  = os.O_RDWR

	CharNewLine = "\n"
	EmptyValue  = ""
	Separator   = "="
)

Variables

View Source
var (
	DirectionApp = storage.GetAppDir()

	ErrWriteDataToOpenFile = errors.New("write data to open file error")
	ErrGetKeyValueData     = errors.New("get value data error")
	ErrKeyOfNonLetters     = errors.New("key of non letters error")
	ErrValueIsInvalid      = errors.New("dont valid value at set data")
	ErrGetOpenFile         = errors.New("get open file error")
)

Functions

func Exists

func Exists(key string) bool

Exists checks if a configuration key is present: - Case-insensitive check - Returns false for invalid keys - Uses simple string contains check

func Get

func Get(key string) string

Get retrieves a configuration value: - Case-insensitive key lookup (converts to uppercase) - Returns empty string if key not found - Validates key before lookup

func Set

func Set(key, value string) error

Set writes or updates a configuration value: - Validates key (letters only) and value - Creates new entry or updates existing one - Automatically converts keys to uppercase Returns error if validation or write fails

Types

This section is empty.

Jump to

Keyboard shortcuts

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