54 lines
901 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package config
import (
"github.com/google/uuid"
"sync"
"time"
)
const (
ContextKeyUser = "user"
ContextKeySession = "session_data"
)
var (
Local = "storage"
LogsDirectory string
DirData string
Storage AuthStorage
JwtSecretKey = []byte(uuid.NewString())
SessionStore sync.Map
SessionFile = "sessions.json"
)
type (
AuthStorage struct {
Users map[string]User
}
User struct {
Email string
Name string
Password string
}
)
// ///////////////// в handlers?
// Работа с файлом (дополнительная опция)
type (
FileSession struct {
ID string `json:"id"`
Data *SessionData `json:"data"`
}
SessionData struct {
Proto string `json:"proto"`
FileName string `json:"file_name"`
IP string `json:"ip"`
Token string `json:"token"`
LastCheck time.Time `json:"last_check"`
}
)