slots

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: 54 Imported by: 0

Documentation

Index

Constants

View Source
const FlashSessionKeyPrefix = "_flash_"

FlashSessionKeyPrefix is the prefix for flash cookies

Variables

This section is empty.

Functions

func HashAspNetHash

func HashAspNetHash(password string, iterations int) (string, error)

HashAspNetHash generates ASP.NET Identity V3 password hashes Format: 0x01 (1 byte) | Prf (4 bytes, SHA256=1) | IterCount (4 bytes) | SaltLen (4 bytes) | Salt | Subkey

func MustResolveValue

func MustResolveValue(val interface{}, scope *engine.Scope, name string) (interface{}, error)

MustResolveValue returns an error if the value is nil or not found. Useful for strict validation in slots.

func RegisterAspNetSlots

func RegisterAspNetSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

RegisterAspNetSlots registers slots for ASP.NET Identity migration

func RegisterAuthSlots

func RegisterAuthSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterCacheSlots

func RegisterCacheSlots(eng *engine.Engine, rdb interface{})

func RegisterCaptchaSlots

func RegisterCaptchaSlots(eng *engine.Engine, r *chi.Mux)

RegisterCaptchaSlots mendaftarkan slot-slot captcha ke engine. Slot yang tersedia:

  • captcha.new : Buat captcha baru dan simpan ID ke scope
  • captcha.verify : Verifikasi jawaban user
  • captcha.image : Tulis PNG captcha ke http.ResponseWriter
  • captcha.serve : Daftarkan route handler bawaan captcha ke router

func RegisterCollectionSlots

func RegisterCollectionSlots(eng *engine.Engine)

func RegisterContainerBridgeSlots

func RegisterContainerBridgeSlots(eng *engine.Engine, r chi.Router)

RegisterContainerBridgeSlots mendaftarkan slot khusus untuk memanggil Container lain

func RegisterDBHookSlots

func RegisterDBHookSlots(eng *engine.Engine)

RegisterDBHookSlots registers the db.hook slot

func RegisterDBSlots

func RegisterDBSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterFileSystemSlots

func RegisterFileSystemSlots(eng *engine.Engine)

func RegisterFunctionSlots

func RegisterFunctionSlots(eng *engine.Engine)

RegisterFunctionSlots mendaftarkan slot 'fn' dan 'call' Mekanisme: 'fn' menyimpan *Node ke GLOBAL REGISTRY, 'call' mengeksekusinya.

func RegisterHTTPClientSlots

func RegisterHTTPClientSlots(eng *engine.Engine)

func RegisterHTTPServerSlots

func RegisterHTTPServerSlots(eng *engine.Engine)

func RegisterIPSecuritySlots

func RegisterIPSecuritySlots(eng *engine.Engine)

func RegisterImageSlots

func RegisterImageSlots(eng *engine.Engine)

func RegisterInertiaSlots

func RegisterInertiaSlots(eng *engine.Engine)

RegisterInertiaSlots registers Inertia.js related slots

func RegisterJSONSlots

func RegisterJSONSlots(eng *engine.Engine)

func RegisterJobSlots

func RegisterJobSlots(eng *engine.Engine, queue worker.JobQueue, setConfig func([]string))

func RegisterMailSlots

func RegisterMailSlots(eng *engine.Engine)

func RegisterMathSlots

func RegisterMathSlots(eng *engine.Engine)

func RegisterMetaSlots

func RegisterMetaSlots(eng *engine.Engine)

func RegisterNetworkSlots

func RegisterNetworkSlots(eng *engine.Engine)

func RegisterORMSlots

func RegisterORMSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterRawDBSlots

func RegisterRawDBSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterRouterSlots

func RegisterRouterSlots(eng *engine.Engine, rootRouter *chi.Mux)

func RegisterSSESlots

func RegisterSSESlots(eng *engine.Engine)

RegisterSSESlots registers Server-Sent Events slots

func RegisterSchemaSlots

func RegisterSchemaSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterSecuritySlots

func RegisterSecuritySlots(eng *engine.Engine)

func RegisterSessionSlots

func RegisterSessionSlots(eng *engine.Engine)

RegisterSessionSlots registers session related slots

func RegisterStorageSlots

func RegisterStorageSlots(eng *engine.Engine)

func RegisterTestSlots

func RegisterTestSlots(eng *engine.Engine)

func RegisterTimeSlots

func RegisterTimeSlots(eng *engine.Engine)

func RegisterTransactionSlots

func RegisterTransactionSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func RegisterUploadSlots

func RegisterUploadSlots(eng *engine.Engine)

func RegisterUtilSlots

func RegisterUtilSlots(eng *engine.Engine)

func RegisterValidatorSlots

func RegisterValidatorSlots(eng *engine.Engine, dbMgr *dbmanager.DBManager)

func VerifyAspNetHash

func VerifyAspNetHash(hashedPassword, providedPassword string) bool

VerifyAspNetHash verifies ASP.NET Identity V3 password hashes Format: 0x01 (1 byte) | Prf (1 byte) | IterCount (4 bytes) | SaltLen (4 bytes) | Salt | Subkey

func WithTestStats

func WithTestStats(ctx context.Context, stats *TestStats) context.Context

WithTestStats injects the stats into the context

Types

type ColumnDef

type ColumnDef struct {
	Name      string
	Type      string
	Limit     int
	Unique    bool
	Nullable  bool
	Precision int
	Scale     int
}

type ForeignKeyDef

type ForeignKeyDef struct {
	Column     string
	References string
	On         string
	OnDelete   string
}

type HookEvent

type HookEvent string
const (
	HookBeforeInsert HookEvent = "before_insert"
	HookAfterInsert  HookEvent = "after_insert"
	HookBeforeUpdate HookEvent = "before_update"
	HookAfterUpdate  HookEvent = "after_update"
	HookBeforeDelete HookEvent = "before_delete"
	HookAfterDelete  HookEvent = "after_delete"
	HookBeforeSave   HookEvent = "before_save" // insert + update
	HookAfterSave    HookEvent = "after_save"  // insert + update
)

type JoinDef

type JoinDef struct {
	Type  string // "INNER", "LEFT", "RIGHT"
	Table string
	On    []string // ["t1.col", "=", "t2.col"]
}

type LocalStorageDriver

type LocalStorageDriver struct {
	// contains filtered or unexported fields
}

LocalStorageDriver handles storage on the local filesystem.

func NewLocalStorageDriver

func NewLocalStorageDriver() *LocalStorageDriver

func (*LocalStorageDriver) Delete

func (l *LocalStorageDriver) Delete(ctx context.Context, path string) error

func (*LocalStorageDriver) Exists

func (l *LocalStorageDriver) Exists(ctx context.Context, path string) (bool, error)

func (*LocalStorageDriver) Put

func (l *LocalStorageDriver) Put(ctx context.Context, path string, content []byte) error

func (*LocalStorageDriver) PutFromFile

func (l *LocalStorageDriver) PutFromFile(ctx context.Context, path string, srcPath string) error

type QueryState

type QueryState struct {
	Table   string
	Columns []string
	Joins   []JoinDef
	Where   []WhereCond
	GroupBy []string
	Having  []WhereCond
	Args    []interface{}
	Limit   int
	Offset  int
	OrderBy string
	DBName  string
	Dialect dbmanager.Dialect
}

func (*QueryState) BuildSQL

func (qs *QueryState) BuildSQL(queryType string) (string, []interface{})

func (*QueryState) Quote

func (qs *QueryState) Quote(name string) string

type S3StorageDriver

type S3StorageDriver struct {
	// contains filtered or unexported fields
}

S3StorageDriver handles storage on AWS S3 or S3-compatible cloud storage (MinIO, R2, Spaces).

func NewS3StorageDriver

func NewS3StorageDriver() (*S3StorageDriver, error)

func (*S3StorageDriver) Delete

func (s *S3StorageDriver) Delete(ctx context.Context, path string) error

func (*S3StorageDriver) Exists

func (s *S3StorageDriver) Exists(ctx context.Context, path string) (bool, error)

func (*S3StorageDriver) Put

func (s *S3StorageDriver) Put(ctx context.Context, path string, content []byte) error

func (*S3StorageDriver) PutFromFile

func (s *S3StorageDriver) PutFromFile(ctx context.Context, path string, srcPath string) error

type SQLExecutor

type SQLExecutor interface {
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}

SQLExecutor interface

type SchemaState

type SchemaState struct {
	Table       string
	Columns     []ColumnDef
	ForeignKeys []ForeignKeyDef
	DBName      string
	Dialect     dbmanager.Dialect
}

func (*SchemaState) BuildSQL

func (s *SchemaState) BuildSQL() (string, error)

type StorageDriver

type StorageDriver interface {
	Put(ctx context.Context, path string, content []byte) error
	PutFromFile(ctx context.Context, path string, srcPath string) error
	Exists(ctx context.Context, path string) (bool, error)
	Delete(ctx context.Context, path string) error
}

StorageDriver defines the contract for all file storage drivers.

type TestStats

type TestStats struct {
	Total  int
	Passed int
	Failed int
	Errors []string
	// contains filtered or unexported fields
}

TestStats tracks the results of the test execution

func (*TestStats) AddFail

func (s *TestStats) AddFail(name string, err error)

func (*TestStats) AddPass

func (s *TestStats) AddPass()

type WhereCond

type WhereCond struct {
	Logical string // "AND" or "OR"
	Column  string
	Op      string
	Value   interface{}
}

Jump to

Keyboard shortcuts

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