utils

package
v0.0.0-...-deca192 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSystemBoundKey

func GenerateSystemBoundKey() ([]byte, error)

generateSystemBoundKey derives an AES key based on the hashed machine ID

func GetHashedMachineID

func GetHashedMachineID() (string, error)

getHashedMachineID retrieves a unique hashed hardware ID for the system

func GetLogger

func GetLogger() *slog.Logger

GetLogger returns the logger instance if initialized, otherwise exits the program

func InitLogger

func InitLogger(logFileName string) error

InitLogger sets up the logger with the specified log file name

func SecurePrompt

func SecurePrompt(prompt string) (string, error)

SecurePrompt hides user input while reading it

func UnsecurePrompt

func UnsecurePrompt(prompt string) (string, error)

UnsecurePrompt shows the user input while reading it

Types

type LogConfig

type LogConfig struct {
	Level    string `yaml:"level"`
	FilePath string `yaml:"file_path"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳