configuration

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultSettings

func GetDefaultSettings() struct {
	CheckInterval        int
	NotificationInterval float64
	CooldownDuration     float64
	StatusChangeCooldown float64
}

func Load

func Load() error

Types

type Config

type Config struct {
	// Admin API Endpoints
	Admin struct {
		Port           int
		APIKey         string
		Enabled        bool
		BasePath       string
		StatsRateLimit float64
		RetentionDays  int
	}

	// Database Performance
	Performance struct {
		DbMaxIdleConns int `json:"db_max_idle_conns"`
		DbMaxOpenConns int `json:"db_max_open_conns"`
	}

	// Environment
	Environment string
	LogDir      string

	// Database Settings
	Database struct {
		User     string
		Password string
		Name     string
		Host     string
		Port     string
		Var      string
	}

	// Discord Settings
	Discord struct {
		Token       string
		DeveloperID string
		ClientID    string
		PublicKey   string
	}

	// Captcha Service Settings
	CaptchaService struct {
		Capsolver struct {
			Enabled       bool
			ClientKey     string
			AppID         string
			BalanceMin    float64
			MaxRetries    int
			RetryInterval time.Duration
		}
		EZCaptcha struct {
			Enabled    bool
			ClientKey  string
			AppID      string
			BalanceMin float64
		}
		TwoCaptcha struct {
			Enabled    bool
			ClientKey  string
			SoftID     string
			BalanceMin float64
		}
		RecaptchaSiteKey string
		RecaptchaURL     string
		MaxRetries       int
	}

	CaptchaEndpoints struct {
		Capsolver struct {
			Create string
			Result string
		}
		EZCaptcha struct {
			Create string
			Result string
		}
		TwoCaptcha struct {
			Create string
			Result string
		}
		MaxRetries    int
		RetryInterval time.Duration
	}

	// API Endpoints
	API struct {
		CheckEndpoint      string
		ProfileEndpoint    string
		CheckVIPEndpoint   string
		RedeemCodeEndpoint string
	}

	// Rate Limits and Intervals
	RateLimits struct {
		CheckNow           time.Duration
		Default            time.Duration
		DefaultMaxAccounts int
		PremiumMaxAccounts int
	}

	// Intervals
	Intervals struct {
		Check              int
		Notification       float64
		Cooldown           float64
		Sleep              int
		PermaBanCheck      float64
		StatusChange       float64
		GlobalNotification float64
		CookieExpiration   float64
		TempBanUpdate      float64
	}

	// User Management Settings
	Users struct {
		MaxMessageFailures     int
		InactiveUserPeriod     time.Duration
		UnreachableResetPeriod time.Duration
	}

	// Verdansk Stats Settings
	Verdansk struct {
		PreferencesEndpoint string
		StatsEndpoint       string
		APIKey              string
		TempDir             string
		CleanupTime         time.Duration
		CommandCooldown     time.Duration // Cooldown between commands per user
		MaxRequestsPerDay   int           // Maximum requests per day per user
	}

	// Notification Settings
	Notifications struct {
		DefaultCooldown      time.Duration
		MaxPerHour           int
		MaxPerDay            int
		MinInterval          time.Duration
		BackoffBaseInterval  time.Duration
		BackoffMaxMultiplier float64
		BackoffHistoryWindow time.Duration
	}

	// Emoji Settings
	Emojis struct {
		CheckCircle    string
		BanCircle      string
		InfoCircle     string
		StopWatch      string
		QuestionCircle string
	}
}
var AppConfig Config

func Get

func Get() *Config

Jump to

Keyboard shortcuts

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