Documentation
¶
Index ¶
- Constants
- func ErrorHandler(error_msg string, app_settings common.AppSettings) func(*gin.Context)
- func NotFoundHandler(app_settings common.AppSettings) func(*gin.Context)
- func SetupRoutes(app_settings common.AppSettings, database database.Database) *gin.Engine
- type Cache
- type CacheValidator
- type EndpointCache
- type Generator
- type RecaptchaResponse
- type TimeValidator
- type TimedCache
Constants ¶
View Source
const CACHE_TIMEOUT = 20 * time.Second
View Source
const MAX_CACHE_SIZE_MB = 10
Do not store over this amount of MBs in the cache
View Source
const RECAPTCHA_VERIFY_URL string = "https://www.google.com/recaptcha/api/siteverify"
Change this in case Google decides to deprecate the reCAPTCHA validation endpoint
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler(error_msg string, app_settings common.AppSettings) func(*gin.Context)
We should probably pass the error status, as we're using the StatusOk
func NotFoundHandler ¶
func NotFoundHandler(app_settings common.AppSettings) func(*gin.Context)
func SetupRoutes ¶
Types ¶
type Cache ¶
type CacheValidator ¶
type CacheValidator interface {
IsValid(cache *EndpointCache) bool
}
type RecaptchaResponse ¶
type TimeValidator ¶
type TimeValidator struct{}
func (*TimeValidator) IsValid ¶
func (validator *TimeValidator) IsValid(cache *EndpointCache) bool
type TimedCache ¶
type TimedCache struct {
// contains filtered or unexported fields
}
func (*TimedCache) Get ¶
func (cache *TimedCache) Get(name string) (EndpointCache, error)
func (*TimedCache) Size ¶
func (cache *TimedCache) Size() uint64
Click to show internal directories.
Click to hide internal directories.