Documentation
¶
Index ¶
- Variables
- func GetActivationExpiry() time.Duration
- func GetCSP() string
- func GetConfigDirectory() string
- func GetConfigName() string
- func GetConnMaxLifetime() int
- func GetDatabasePath() string
- func GetDefaultConfigFilePath() string
- func GetDefaultDatabaseFilePath() string
- func GetDefaultUserRoles() []string
- func GetDraftTimeLimit() int
- func GetEditUpdateLimit() int
- func GetEmailCooldown() time.Duration
- func GetEmailFrom() string
- func GetEmailHost() string
- func GetEmailPassword() string
- func GetEmailPort() int
- func GetEmailUser() string
- func GetFaviconPath() (*string, error)
- func GetGuidelinesURL() string
- func GetHTTPUpgrade() bool
- func GetHost() string
- func GetHostURL() string
- func GetImageJpegQuality() int
- func GetImageLocation() string
- func GetImageMaxSize() *int
- func GetIsProduction() bool
- func GetJWTSignKey() []byte
- func GetLogFile() string
- func GetLogLevel() string
- func GetLogOut() bool
- func GetMaxIdleConns() int
- func GetMaxOpenConns() int
- func GetMinDestructiveVotingPeriod() int
- func GetMissingEmailSettings() []string
- func GetPHashDistance() int
- func GetPort() int
- func GetProfilerPort() *int
- func GetRequireActivation() bool
- func GetRequireInvite() bool
- func GetRequireSceneDraft() bool
- func GetRequireTagRole() bool
- func GetSSLCert() string
- func GetSSLKey() string
- func GetSessionStoreKey() []byte
- func GetTitle() string
- func GetUserLogFile() string
- func GetVoteApplicationThreshold() int
- func GetVoteCronInterval() string
- func GetVotePromotionThreshold() *int
- func GetVotingPeriod() int
- func Initialize() error
- func InitializeDefaults() error
- func ValidateImageLocation() error
- type ImageBackendType
- type ImageResizeConfig
- type OTelConfig
- type PostgresConfig
- type S3Config
Constants ¶
This section is empty.
Variables ¶
var C = &config{ RequireInvite: true, RequireActivation: false, ActivationExpiry: 2 * 60 * 60, EmailCooldown: 5 * 60, EmailPort: 25, ImageBackend: string(FileBackend), PHashDistance: 0, VoteApplicationThreshold: 3, VotePromotionThreshold: 10, VoteCronInterval: "5m", VotingPeriod: 345600, MinDestructiveVotingPeriod: 172800, DraftTimeLimit: 86400, EditUpdateLimit: 1, RequireSceneDraft: false, RequireTagRole: false, }
var Database = "database"
var JWTSignKey = "jwt_secret_key"
var SessionStoreKey = "session_store_key"
Functions ¶
func GetActivationExpiry ¶
GetActivationExpiry returns the duration before an activation email expires.
func GetConfigDirectory ¶
func GetConfigDirectory() string
func GetConfigName ¶
func GetConfigName() string
func GetConnMaxLifetime ¶
func GetConnMaxLifetime() int
func GetDatabasePath ¶
func GetDatabasePath() string
func GetDefaultConfigFilePath ¶
func GetDefaultConfigFilePath() string
func GetDefaultDatabaseFilePath ¶
func GetDefaultDatabaseFilePath() string
func GetDefaultUserRoles ¶
func GetDefaultUserRoles() []string
GetDefaultUserRoles returns the default roles assigned to a new user when created via registration.
func GetDraftTimeLimit ¶
func GetDraftTimeLimit() int
func GetEditUpdateLimit ¶
func GetEditUpdateLimit() int
func GetEmailCooldown ¶
GetEmailCooldown returns the duration before a second activation email may be generated.
func GetEmailFrom ¶
func GetEmailFrom() string
func GetEmailHost ¶
func GetEmailHost() string
func GetEmailPassword ¶
func GetEmailPassword() string
func GetEmailPort ¶
func GetEmailPort() int
func GetEmailUser ¶
func GetEmailUser() string
func GetFaviconPath ¶
func GetGuidelinesURL ¶
func GetGuidelinesURL() string
func GetHTTPUpgrade ¶
func GetHTTPUpgrade() bool
func GetHostURL ¶
func GetHostURL() string
func GetImageJpegQuality ¶
func GetImageJpegQuality() int
func GetImageLocation ¶
func GetImageLocation() string
GetImageLocation returns the path of where to locally store images.
func GetImageMaxSize ¶
func GetImageMaxSize() *int
func GetIsProduction ¶
func GetIsProduction() bool
func GetJWTSignKey ¶
func GetJWTSignKey() []byte
func GetLogFile ¶
func GetLogFile() string
GetLogFile returns the filename of the file to output logs to. An empty string means that file logging will be disabled.
func GetLogLevel ¶
func GetLogLevel() string
GetLogLevel returns the lowest log level to write to the log. Should be one of "Debug", "Info", "Warning", "Error"
func GetLogOut ¶
func GetLogOut() bool
GetLogOut returns true if logging should be output to the terminal in addition to writing to a log file. Logging will be output to the terminal if file logging is disabled. Defaults to true.
func GetMaxIdleConns ¶
func GetMaxIdleConns() int
func GetMaxOpenConns ¶
func GetMaxOpenConns() int
func GetMinDestructiveVotingPeriod ¶
func GetMinDestructiveVotingPeriod() int
func GetMissingEmailSettings ¶
func GetMissingEmailSettings() []string
func GetPHashDistance ¶
func GetPHashDistance() int
func GetProfilerPort ¶
func GetProfilerPort() *int
func GetRequireActivation ¶
func GetRequireActivation() bool
GetRequireActivation returns true if new users must validate their email address via activation to create an account.
func GetRequireInvite ¶
func GetRequireInvite() bool
GetRequireInvite returns true if new users cannot register without an invite key.
func GetRequireSceneDraft ¶
func GetRequireSceneDraft() bool
func GetRequireTagRole ¶
func GetRequireTagRole() bool
func GetSSLCert ¶
func GetSSLCert() string
func GetSessionStoreKey ¶
func GetSessionStoreKey() []byte
func GetUserLogFile ¶
func GetUserLogFile() string
GetUserLogFile returns the filename of the file to output user operation logs to. An empty string means that user operation logging will be output to stderr.
func GetVoteApplicationThreshold ¶
func GetVoteApplicationThreshold() int
func GetVoteCronInterval ¶
func GetVoteCronInterval() string
func GetVotePromotionThreshold ¶
func GetVotePromotionThreshold() *int
func GetVotingPeriod ¶
func GetVotingPeriod() int
func InitializeDefaults ¶
func InitializeDefaults() error
func ValidateImageLocation ¶
func ValidateImageLocation() error
ValidateImageLocation returns an error is image_location is not set.
Types ¶
type ImageBackendType ¶
type ImageBackendType string
const ( FileBackend ImageBackendType = "file" S3Backend ImageBackendType = "s3" )
func GetImageBackend ¶
func GetImageBackend() ImageBackendType
GetImageBackend returns the backend used to store images.
type ImageResizeConfig ¶
type ImageResizeConfig struct {
Enabled bool `mapstructure:"enabled"`
CachePath string `mapstructure:"cache_path"`
MinSize int `mapstructure:"min_size"`
}
func GetImageResizeConfig ¶
func GetImageResizeConfig() *ImageResizeConfig
type OTelConfig ¶
type OTelConfig struct {
Endpoint string `mapstructure:"endpoint"`
TraceRatio float64 `mapstructure:"trace_ratio"`
}
func GetOTelConfig ¶
func GetOTelConfig() *OTelConfig
type PostgresConfig ¶
type S3Config ¶
type S3Config struct {
Endpoint string `mapstructure:"endpoint"`
Bucket string `mapstructure:"bucket"`
AccessKey string `mapstructure:"access_key"`
Secret string `mapstructure:"secret"`
MaxDimension int `mapstructure:"max_dimension"`
UploadHeaders map[string]string `mapstructure:"upload_headers"`
}
func GetS3Config ¶
func GetS3Config() *S3Config