Documentation
¶
Index ¶
- Variables
- func CDNMaxedOut(c *fiber.Ctx) error
- func PublicMaxedOut(c *fiber.Ctx) error
- type Server
- func (s *Server) AdminLogin(context *fiber.Ctx) error
- func (s *Server) AdminLogout(context *fiber.Ctx) error
- func (s *Server) Get(bucket_name string, key string) (result string)
- func (s *Server) GetLogMessages(c *fiber.Ctx) error
- func (s *Server) GetOBJ(bucket_name string, key string) (result interface{})
- func (s *Server) LogRequest(context *fiber.Ctx) error
- func (s *Server) LoginPage(context *fiber.Ctx) error
- func (s *Server) RenderFailedLogin(context *fiber.Ctx) error
- func (s *Server) RenderHomePage(context *fiber.Ctx) error
- func (s *Server) Set(bucket_name string, key string, value string)
- func (s *Server) SetOBJ(bucket_name string, key string, obj interface{})
- func (s *Server) SetupAdminRoutes()
- func (s *Server) SetupPublicRoutes()
- func (s *Server) Start()
- func (s *Server) StaticHandler(prefix string, fsys fs.FS) fiber.Handler
- func (s *Server) ValidateAdmin(context *fiber.Ctx) (result bool)
- func (s *Server) ValidateAdminLoginCredentials(context *fiber.Ctx) (result bool)
- func (s *Server) ValidateAdminMW(context *fiber.Ctx) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ADMIN_HTML_FILE fs.File
View Source
var ADMIN_HTML_FILE_SIZE int
View Source
var CDNFiles embed.FS
View Source
var CDNFilesFS fs.FS
View Source
var CDNLimter = rate_limiter.New(rate_limiter.Config{ Max: 6, Expiration: 1 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get("x-forwarded-for") }, LimitReached: CDNMaxedOut, LimiterMiddleware: rate_limiter.SlidingWindow{}, })
View Source
var HOME_HTML_FILE fs.File
View Source
var HOME_HTML_FILE_SIZE int
View Source
var HTMLFiles embed.FS
View Source
var HTMLFilesFS fs.FS
View Source
var LOGIN_HTML_FILE fs.File
View Source
var LOGIN_HTML_FILE_SIZE int
View Source
var PublicLimter = rate_limiter.New(rate_limiter.Config{ Max: 3, Expiration: 1 * time.Second, KeyGenerator: func(c *fiber.Ctx) string { return c.Get("x-forwarded-for") }, LimitReached: PublicMaxedOut, LimiterMiddleware: rate_limiter.SlidingWindow{}, })
Functions ¶
func CDNMaxedOut ¶
func PublicMaxedOut ¶
Types ¶
type Server ¶
type Server struct { FiberApp *fiber.App `yaml:"fiber_app"` Config *types.Config `yaml:"config"` Location *time.Location `yaml:"-"` DB *bolt.DB `yaml:"-"` LOG *logger.Wrapper `yaml:"-"` }
func (*Server) AdminLogin ¶
func (*Server) SetupAdminRoutes ¶
func (s *Server) SetupAdminRoutes()
func (*Server) SetupPublicRoutes ¶
func (s *Server) SetupPublicRoutes()
func (*Server) StaticHandler ¶
Custom static file handler for embedded files
func (*Server) ValidateAdminLoginCredentials ¶
Click to show internal directories.
Click to hide internal directories.