Documentation
¶
Index ¶
- func BuildRouter(app *AppContext) (*chi.Mux, error)
- func RegisterAllSlots(eng *engine.Engine, r *chi.Mux, dbMgr *dbmanager.DBManager, ...)
- func RegisterSlots(eng *engine.Engine, opts ...RegisterOption)
- type AppContext
- type HotRouter
- type RegisterOption
- func WithAuth(dbMgr *dbmanager.DBManager) RegisterOption
- func WithBlade() RegisterOption
- func WithCache() RegisterOption
- func WithCore() RegisterOption
- func WithDB(dbMgr *dbmanager.DBManager) RegisterOption
- func WithData(dbMgr *dbmanager.DBManager) RegisterOption
- func WithExtra(queue worker.JobQueue, setConfig func([]string)) RegisterOption
- func WithJob(queue worker.JobQueue, setConfig func([]string)) RegisterOption
- func WithMail() RegisterOption
- func WithRouter(r *chi.Mux) RegisterOption
- func WithValidator(dbMgr *dbmanager.DBManager) RegisterOption
- func WithWeb(r *chi.Mux) RegisterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRouter ¶
func BuildRouter(app *AppContext) (*chi.Mux, error)
BuildRouter: Membaca main.zl dan membangun Router Chi baru
func RegisterAllSlots ¶
func RegisterAllSlots(eng *engine.Engine, r *chi.Mux, dbMgr *dbmanager.DBManager, queue worker.JobQueue, setConfig func([]string))
RegisterAllSlots membungkus pendaftaran seluruh slot yang tersedia di ZenoEngine (Backward Compatibility)
func RegisterSlots ¶
func RegisterSlots(eng *engine.Engine, opts ...RegisterOption)
RegisterSlots mendaftarkan slot ke Engine secara selektif berdasarkan opsi yang dipilih
Types ¶
type AppContext ¶
type AppContext struct {
DBMgr *dbmanager.DBManager
Queue worker.JobQueue
Env string
Hot *HotRouter
WorkerQueues []string
}
AppContext menyimpan dependensi global
type HotRouter ¶
type HotRouter struct {
// contains filtered or unexported fields
}
HotRouter adalah wrapper agar kita bisa mengganti router saat runtime
type RegisterOption ¶
type RegisterOption func(*registerConfig)
RegisterOption mendefinisikan tanda tangan fungsi opsi konfigurasi
func WithAuth ¶
func WithAuth(dbMgr *dbmanager.DBManager) RegisterOption
WithAuth mengaktifkan pendaftaran slot Auth & ASP.NET membership
func WithBlade ¶
func WithBlade() RegisterOption
WithBlade mengaktifkan pendaftaran slot Blade template
func WithCache ¶
func WithCache() RegisterOption
WithCache mengaktifkan pendaftaran slot in-memory caching
func WithCore ¶
func WithCore() RegisterOption
WithCore mendaftarkan seluruh slot dasar (Core Slots) secara kolektif
func WithDB ¶
func WithDB(dbMgr *dbmanager.DBManager) RegisterOption
WithDB mengaktifkan pendaftaran slot database (DB, ORM, Schema, DB Hook, dll)
func WithData ¶
func WithData(dbMgr *dbmanager.DBManager) RegisterOption
WithData mendaftarkan seluruh slot pengolahan data secara kolektif dengan DBManager yang ditentukan
func WithExtra ¶
func WithExtra(queue worker.JobQueue, setConfig func([]string)) RegisterOption
WithExtra mendaftarkan slot tambahan secara kolektif (Mail, Cache, Jobs)
func WithJob ¶
func WithJob(queue worker.JobQueue, setConfig func([]string)) RegisterOption
WithJob mengaktifkan pendaftaran slot background jobs/worker queue
func WithMail ¶
func WithMail() RegisterOption
WithMail mengaktifkan pendaftaran slot pengiriman Email
func WithRouter ¶
func WithRouter(r *chi.Mux) RegisterOption
WithRouter mengaktifkan pendaftaran slot web router
func WithValidator ¶
func WithValidator(dbMgr *dbmanager.DBManager) RegisterOption
WithValidator mengaktifkan pendaftaran slot Validator
func WithWeb ¶
func WithWeb(r *chi.Mux) RegisterOption
WithWeb mendaftarkan seluruh slot web secara kolektif dengan router yang ditentukan