Documentation ¶
Index ¶
- Constants
- type Cleanup
- type Config
- type Module
- type Moduler
- type Sloop
- func (s *Sloop) AddModulers(m ...Moduler) *Sloop
- func (s *Sloop) Cleanup()
- func (s *Sloop) Router() fiber.Router
- func (s *Sloop) Run(addr string) error
- func (s *Sloop) RunTls(addr, certFile, keyFile string) error
- func (s *Sloop) Setup() *Sloop
- func (s *Sloop) Shutdown() error
- func (s *Sloop) Watch()
Constants ¶
View Source
const Version = "0.4.0"
Version of current dawn package
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// App indicates to fiber app instance
App *fiber.App
}
Config is a struct holding the sloop settings.
type Module ¶
type Module struct{}
Module is an empty struct implements Moduler interface and can be embedded into custom struct as a Moduler
func (Module) RegisterRoutes ¶
func (Module) RegisterRoutes(fiber.Router)
RegisterRoutes add routes to fiber router
type Moduler ¶
type Moduler interface { // Stringer indicates module's name fmt.Stringer // Init does initialization works and should return // a cleanup function. Init() Cleanup // Boot boots the module. Boot() // RegisterRoutes add routes to fiber router RegisterRoutes(fiber.Router) }
Moduler is the interface that wraps the module's method.
type Sloop ¶
type Sloop struct { // Config is the embedded config Config // contains filtered or unexported fields }
Sloop denotes Dawn application
func Default ¶
func Default(cfg ...fiber.Config) *Sloop
Default returns an Sloop instance with the `RequestID`, `Logger`, `Recovery`, `Pprof` middleware already attached in default fiber app.
func (*Sloop) AddModulers ¶
AddModulers appends more Modulers
Click to show internal directories.
Click to hide internal directories.