app

package
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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

func (*HotRouter) ServeHTTP

func (h *HotRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*HotRouter) Swap

func (h *HotRouter) Swap(newRouter *chi.Mux)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL