config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName     = "mkdb"
	DBFileName  = "mkdb.db"
	LogFileName = "mkdb.log"
	KeyFileName = ".encryption.key"
)
View Source
const SettingsFileName = "last_settings.json"

Variables

View Source
var (
	DataDir    string
	DBPath     string
	LogPath    string
	VolumesDir string
	Logger     *log.Logger
)

Functions

func Decrypt

func Decrypt(ciphertext string) (string, error)

Decrypt decrypts ciphertext using AES-GCM

func Encrypt

func Encrypt(plaintext string) (string, error)

Encrypt encrypts plaintext using AES-GCM

func HasLastSettings

func HasLastSettings() bool

HasLastSettings checks if last settings exist

func Initialize

func Initialize() error

Initialize sets up the configuration directories and logger

func SaveLastSettings

func SaveLastSettings(settings *LastSettings) error

SaveLastSettings saves settings to disk

Types

type LastSettings

type LastSettings struct {
	DBType     string `json:"db_type"`
	Name       string `json:"name"`
	Version    string `json:"version"`
	Port       string `json:"port"`
	VolumeType string `json:"volume_type"`
	VolumePath string `json:"volume_path"`
	TTLHours   int    `json:"ttl_hours"`
}

LastSettings stores the last used settings for quick repeat

func LoadLastSettings

func LoadLastSettings() (*LastSettings, error)

LoadLastSettings loads settings from disk

Jump to

Keyboard shortcuts

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