Documentation
¶
Index ¶
- func AdminOnly(ctx *gin.Context)
- func AuthenticateCookie(ctx *gin.Context)
- func AuthenticateGuild(requiredPermissionLevel permission.PermissionLevel) gin.HandlerFunc
- func AuthenticateToken(ctx *gin.Context)
- func Cors(config config.Config) func(*gin.Context)
- func CreateRateLimiter(rlType RateLimitType, max int, period time.Duration) gin.HandlerFunc
- func ErrorHandler(c *gin.Context)
- func Logging(logger *zap.Logger) gin.HandlerFunc
- func MultiReadBody(ctx *gin.Context)
- func ParseGuildId(ctx *gin.Context)
- func ReadResponse(ctx *gin.Context)
- func UpdateLastSeen(req *gin.Context)
- func VerifyWhitelabel(isApi bool) func(ctx *gin.Context)
- func VerifyXTicketsHeader(ctx *gin.Context)
- type CustomWriter
- type ErrorResponse
- type RateLimitType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateCookie ¶
func AuthenticateGuild ¶
func AuthenticateGuild(requiredPermissionLevel permission.PermissionLevel) gin.HandlerFunc
requires AuthenticateCookie middleware to be run before
func AuthenticateToken ¶
func CreateRateLimiter ¶
func CreateRateLimiter(rlType RateLimitType, max int, period time.Duration) gin.HandlerFunc
func ErrorHandler ¶
func MultiReadBody ¶
func ParseGuildId ¶
func ReadResponse ¶
func UpdateLastSeen ¶
UpdateLastSeen We store the last time a user was seen in the dashboard so that we can delete their data if they haven't logged in for 30 days.
func VerifyWhitelabel ¶
func VerifyXTicketsHeader ¶
Types ¶
type CustomWriter ¶
type CustomWriter struct { gin.ResponseWriter // contains filtered or unexported fields }
func NewCustomWriter ¶
func NewCustomWriter(ctx *gin.Context) *CustomWriter
func (*CustomWriter) Read ¶
func (w *CustomWriter) Read() []byte
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type RateLimitType ¶
type RateLimitType uint8
const ( RateLimitTypeIp RateLimitType = iota RateLimitTypeUser RateLimitTypeGuild )
Click to show internal directories.
Click to hide internal directories.