Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(app *appForge) error
Option can be passed to Forge() to control the forging process.
func WithConfLoader ¶ added in v0.1.1
func WithConfLoader(confL core.ConfLoader) Option
WithConfLoader can be used to set a custom config loader.
func WithPostHook ¶ added in v0.1.1
func WithPostHook(hook func(app PostContext) error) Option
WithPostHook can be used to set a post-hook for Forge(). This hook will be invoked when all modules and base router is initialised. This can be used to set-up additional routes, etc.
func WithPreHook ¶ added in v0.4.0
func WithPreHook(hook func(app PreContext) error) Option
WithPreHook can be used to set a pre-hook for Forge(). This hook will be invoked when config-loader is initialized. Auth and other modules can be initialized here.
type PostContext ¶ added in v0.4.0
type PostContext interface { Auth() core.Auth Router() chi.Router Configs() core.ConfLoader Authenticate() Middleware }
PostContext is the app state after fully initialised.
type PreContext ¶ added in v0.4.0
type PreContext interface { Configs() core.ConfLoader SetAuth(auth core.Auth) SetRouter(r chi.Router) }
PreContext is the app state before fully initialised.
Click to show internal directories.
Click to hide internal directories.