Documentation
¶
Index ¶
- Constants
- func GetCallbackURL() string
- func GetConfigPath() string
- func IsDevelopment() bool
- func IsProduction() bool
- type AuthConfig
- type Config
- type DatabaseConfig
- type JwtInstanceSingleton
- type KeyManager
- type LogConfig
- type PasswordConfigStruct
- type RedisConfig
- type SentryConfig
- type ServerConfig
Constants ¶
View Source
const ( ExpirationTimeInHours = 24 // ExpirationTimeInHours is the expiration time for the JWT token SQLMaxOpenConns = 10 // SQLMaxOpenConns is the max number of connections in the open connection pool SQLMaxIdleConns = 1 // SQLMaxIdleConns is the max number of connections in the idle connection pool OauthStateLength = 16 // OauthStateLength is the length of the state for oauth RedisDefaultExpireTime = 6 * time.Hour // RedisDefaultExpireTime is the default expiration time for keys CacheExpireTime = 10 * time.Second // CacheExpireTime is the expiration time for the cache GCThresholdPercent = 0.7 // GCThresholdPercent is the threshold for garbage collection GCLimit = 1024 * 1024 * 1024 // GCLimit is the limit for garbage collection RistrettoMaxCost = 3 * MB // RistrettoMaxCost is the maximum cost RistrettoBufferItems = 32 // RistrettoBufferItems is the number of items per get buffer RistrettoNumCounters = 1e4 // RistrettoNumCounters is the number of counters MB = 1024 * 1024 // MB is the number of bytes in a megabyte MaxPasswordLength = 72 // MaxPasswordLength is the max password length MinPasswordLength = 8 // MinPasswordLength is the min password length SentryFlushTimeout = 2 * time.Second // SentryFlushTimeout is the timeout for flushing sentry )
Variables ¶
This section is empty.
Functions ¶
func GetCallbackURL ¶
func GetCallbackURL() string
func GetConfigPath ¶
func GetConfigPath() string
func IsDevelopment ¶
func IsDevelopment() bool
func IsProduction ¶
func IsProduction() bool
Types ¶
type AuthConfig ¶ added in v1.2.2
type AuthConfig struct { JWTSecret string JWTHeaderLen int JWTExpiration int Discord oauth.DiscordConfig Github oauth.GithubConfig Bcryptcost int }
AuthConfig holds the configuration for the authentication.
type Config ¶
type Config struct { Server ServerConfig Database DatabaseConfig Redis RedisConfig Log LogConfig Auth AuthConfig Sentry SentryConfig }
Config holds the configuration for the application.
func LoadConfig ¶ added in v1.2.2
LoadConfig loads the configuration from a file.
type DatabaseConfig ¶ added in v1.2.2
type DatabaseConfig struct {
DSN string
}
DatabaseConfig holds the configuration for the database.
type JwtInstanceSingleton ¶ added in v1.2.2
type JwtInstanceSingleton struct {
// contains filtered or unexported fields
}
func GetJwtInstance ¶
func GetJwtInstance() *JwtInstanceSingleton
func (*JwtInstanceSingleton) GetJwt ¶ added in v1.2.2
func (j *JwtInstanceSingleton) GetJwt() myJwt.Instance
func (*JwtInstanceSingleton) SetJwt ¶ added in v1.2.2
func (j *JwtInstanceSingleton) SetJwt(instance myJwt.Instance)
type KeyManager ¶ added in v1.2.2
type KeyManager struct {
// contains filtered or unexported fields
}
func GetKeyManagerInstance ¶ added in v1.2.2
func GetKeyManagerInstance() *KeyManager
func (*KeyManager) GetPrivateKey ¶ added in v1.2.2
func (k *KeyManager) GetPrivateKey() ed25519.PrivateKey
func (*KeyManager) GetPublicKey ¶ added in v1.2.2
func (k *KeyManager) GetPublicKey() ed25519.PublicKey
func (*KeyManager) ParseEd25519Key ¶ added in v1.2.2
func (k *KeyManager) ParseEd25519Key() error
type LogConfig ¶ added in v1.2.2
type LogConfig struct {
Level string
}
LogConfig holds the configuration for the logger.
func (*LogConfig) GetSlogLevel ¶ added in v1.2.2
type PasswordConfigStruct ¶
type PasswordConfigStruct struct { Iterations uint32 // Iterations to use for Argon2ID Memory uint32 // Memory to use for Argon2ID Threads uint8 // Threads to use for Argon2ID KeyLen uint32 // KeyLen to use for Argon2ID SaltLen uint32 // SaltLen to use for Argon2ID }
PasswordConfigStruct is the struct for the password config.
type RedisConfig ¶ added in v1.2.2
type RedisConfig struct { Addr string Password string MinIdleConns int PoolSize int PoolTimeout int }
RedisConfig holds the configuration for the redis client.
Click to show internal directories.
Click to hide internal directories.