Add environment variables and encryptor package

This commit is contained in:
Archer Fox
2025-03-18 22:04:43 +03:00
parent 69be01a1db
commit e7b8eb5601
5 changed files with 48 additions and 9 deletions

View File

@@ -0,0 +1,25 @@
package encrypter
import "os"
type Encrypter struct {
Key string
}
func NewEncrypter() *Encrypter {
key := os.Getenv("KEY")
if key == "" {
panic("Не передан параметр KEY в переменные окружения")
}
return &Encrypter{
Key: key,
}
}
func (enc *Encrypter) Encrypt(plainStr string) string {
return ""
}
func (enc *Encrypter) Decrypt(encryptedStr string) string {
return ""
}