config

package
v0.0.0-...-be61b1a Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinLengthPassword     int = 12
	MaxLengthPassword     int = 50
	MaxLengthEmailAddress int = 60
	// Cookie
	AuthCookieLifetimeSeconds    int    = 1 * 60 * 60 // One hour
	AuthCookieJWTLifetimeSeconds int    = 1 * 60 * 60 //1 * 60 * 60 // One hour
	AuthCookieName               string = "authCookie"
	//
	TimeValidVerifyTokenMinutes int = 15
)
View Source
const (
	URL string = "https://www.example.com"
	//http.Server configuration
	WriteTimeout        int = 20
	ReadTimeout         int = 20
	IdleTimeout         int = 60
	DeleteLogsAfterDays int = 5
	// Email
	EmailSendNotifications   bool   = false // If false, no email notifications at all (error & success)
	EmailProviderUserNameEnv string = "EMAIL_PROVIDER_USERNAME"
	EmailProviderPasswordEnv string = "EMAIL_PROVIDER_PASSWORD"
	EmailProviderSMTPPortEnv string = "EMAIL_PROVIDER_SMTP_PORT"
	EmailProviderHostEnv     string = "EMAIL_PROVIDER_HOST"
	EmailAddressSenderEnv    string = "EMAIL_ADDRESS_SENDER_BACKUP"
	EmailAddressReceiverEnv  string = "EMAIL_ADDRESS_RECEIVER_BACKUP"
	// AWS S3 Production config .env variable names
	S3BucketEnv    string = "AWS_S3_BUCKET_NAME"
	S3RegionEnv    string = "AWS_REGION"
	S3AccessKeyEnv string = "AWS_ACCESS_KEY_ID"
	S3SecretKeyEnv string = "AWS_SECRET_ACCESS_KEY"
	// Plant config
	PlantNameLength    int = 50
	IntervalSecDefault int = 15 * 60 // Default interval, in seconds, for enabling data logging to the plant logger.
)
View Source
const (
	DatabaseNameUserAuth          string = "PlantDB"
	DatabaseNameFiles             string = "PlantDB"
	DatabaseNamePlants            string = "PlantDB"
	DatabaseNamePlantLoggerConfig string = "PlantDB"
	DatabaseNamePlantLogger       string = "PlantDBLogger"
	// Client config production
	MongoDatabaseSchemeEnv   string = "MONGODB_SCHEME"
	MongoDatabaseUsernameEnv string = "MONGODB_USERNAME"
	MongoDatabasePasswordEnv string = "MONGODB_PASSWORD"
	MongoDatabaseHostdEnv    string = "MONGODB_HOST"
	MongoDatabasePortEnv     string = "MONGODB_PORT"
	// Collection names
	UserAuthCollectionName          string = "user_auth"
	CollectionNameFiles             string = "files"
	CollectionNamePhotovoltaicPlant string = "pv_plants"
	CollectionNamePlantLoggerConfig string = "plant_logger_config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	MongoClient *mongo.Client
}

AppConfig holds the application configuration; here for the mongo connection

type RegexPatterns

type RegexPatterns struct {
	Ipv4     *regexp.Regexp
	Ipv6     *regexp.Regexp
	UUID     *regexp.Regexp
	URL      *regexp.Regexp
	Email    *regexp.Regexp
	Password *regexp.Regexp
}

Add more regex patterns as needed

var Regex RegexPatterns

Jump to

Keyboard shortcuts

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