Documentation ¶
Index ¶
- Variables
- func GetActivationExpireTime() time.Time
- func GetActivationExpiry() time.Duration
- func GetConnMaxLifetime() int
- func GetDatabasePath() string
- func GetDefaultUserRoles() []string
- func GetDraftTimeLimit() 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 GetImageLocation() string
- 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 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 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, }
var Database = "database"
var JWTSignKey = "jwt_secret_key"
var SessionStoreKey = "session_store_key"
Functions ¶
func GetActivationExpireTime ¶
GetActivationExpireTime returns the time at which activation emails expire, using the current time as the basis.
func GetActivationExpiry ¶
GetActivationExpiry returns the duration before an activation email expires.
func GetConnMaxLifetime ¶ added in v0.1.7
func GetConnMaxLifetime() int
func GetDatabasePath ¶
func GetDatabasePath() string
func GetDefaultUserRoles ¶
func GetDefaultUserRoles() []string
GetDefaultUserRoles returns the default roles assigned to a new user when created via registration.
func GetDraftTimeLimit ¶ added in v0.1.0
func GetDraftTimeLimit() 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 ¶ added in v0.1.0
func GetGuidelinesURL ¶ added in v0.5.1
func GetGuidelinesURL() string
func GetHTTPUpgrade ¶
func GetHTTPUpgrade() bool
func GetHostURL ¶
func GetHostURL() string
func GetImageLocation ¶
func GetImageLocation() string
GetImageLocation returns the path of where to locally store images.
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 ¶ added in v0.1.7
func GetMaxIdleConns() int
func GetMaxOpenConns ¶ added in v0.1.7
func GetMaxOpenConns() int
func GetMinDestructiveVotingPeriod ¶ added in v0.1.0
func GetMinDestructiveVotingPeriod() int
func GetMissingEmailSettings ¶
func GetMissingEmailSettings() []string
func GetPHashDistance ¶
func GetPHashDistance() int
func GetProfilerPort ¶ added in v0.1.6
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 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 ¶ added in v0.1.0
func GetVoteApplicationThreshold() int
func GetVoteCronInterval ¶ added in v0.1.0
func GetVoteCronInterval() string
func GetVotePromotionThreshold ¶ added in v0.1.0
func GetVotePromotionThreshold() *int
func GetVotingPeriod ¶ added in v0.1.0
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 PostgresConfig ¶ added in v0.1.7
type S3Config ¶
type S3Config struct { BaseURL string `mapstructure:"base_url"` Endpoint string `mapstructure:"endpoint"` Bucket string `mapstructure:"bucket"` AccessKey string `mapstructure:"access_key"` Secret string `mapstructure:"secret"` MaxDimension int64 `mapstructure:"max_dimension"` UploadHeaders map[string]string `mapstructure:"upload_headers"` }
func GetS3Config ¶
func GetS3Config() *S3Config