Documentation
¶
Index ¶
- type AppConfig
- func (ac *AppConfig) AddSchemas(schemas ...*schema.Schema)
- func (ac *AppConfig) OnPostDBCreate(value *qjs.Value) error
- func (ac *AppConfig) OnPostDBDelete(value *qjs.Value) error
- func (ac *AppConfig) OnPostDBExec(value *qjs.Value) error
- func (ac *AppConfig) OnPostDBQuery(value *qjs.Value) error
- func (ac *AppConfig) OnPostDBUpdate(value *qjs.Value) error
- func (ac *AppConfig) OnPostResolve(value *qjs.Value) (err error)
- func (ac *AppConfig) OnPreDBCreate(value *qjs.Value) error
- func (ac *AppConfig) OnPreDBDelete(value *qjs.Value) error
- func (ac *AppConfig) OnPreDBExec(value *qjs.Value) error
- func (ac *AppConfig) OnPreDBQuery(value *qjs.Value) (err error)
- func (ac *AppConfig) OnPreDBUpdate(value *qjs.Value) error
- func (ac *AppConfig) OnPreResolve(value *qjs.Value) (err error)
- func (ac *AppConfig) Set(config map[string]any) error
- type AppLike
- type Builder
- func (b *Builder) Count(ctx context.Context) (int, error)
- func (b *Builder) Create(ctx context.Context, value map[string]any) (*entity.Entity, error)
- func (b *Builder) Delete(ctx context.Context) (int, error)
- func (b *Builder) First(ctx context.Context) (*entity.Entity, error)
- func (b *Builder) Get(ctx context.Context) ([]*entity.Entity, error)
- func (b *Builder) Limit(limit uint) *Builder
- func (b *Builder) Offset(offset uint) *Builder
- func (b *Builder) Only(ctx context.Context) (*entity.Entity, error)
- func (b *Builder) Select(fields []string) *Builder
- func (b *Builder) Update(ctx context.Context, value map[string]any) ([]*entity.Entity, error)
- func (b *Builder) Where(predicates ...map[string]any) (*Builder, error)
- type DB
- func (d *DB) Builder(schemaName string) (*Builder, error)
- func (d *DB) Close() error
- func (d *DB) Commit() error
- func (d *DB) Create(ctx context.Context, schemaName string, value map[string]any) (*entity.Entity, error)
- func (d *DB) Exec(ctx context.Context, query string, args []any) (sql.Result, error)
- func (d *DB) Query(ctx context.Context, query string, args []any) ([]*entity.Entity, error)
- func (d *DB) Rollback() error
- func (d *DB) Tx(ctx context.Context) (*DB, error)
- type Manager
- type Plugin
- func (p *Plugin) Config() (err error)
- func (p *Plugin) EvalPluginFile(rt *qjs.Runtime, inPool bool) (err error)
- func (p *Plugin) Init() (err error)
- func (p *Plugin) InvokeJsFunc(jsFuncName string, args ...any) (*qjs.Value, error)
- func (p *Plugin) Name() string
- func (p *Plugin) WithJSFuncName(v *qjs.Value, cb func(jsFuncName string)) error
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶ added in v0.9.0
type AppConfig struct {
// contains filtered or unexported fields
}
func NewAppConfig ¶ added in v0.9.0
func (*AppConfig) AddSchemas ¶ added in v0.9.0
func (*AppConfig) OnPostDBCreate ¶ added in v0.9.0
func (*AppConfig) OnPostDBDelete ¶ added in v0.9.0
func (*AppConfig) OnPostDBExec ¶ added in v0.9.0
func (*AppConfig) OnPostDBQuery ¶ added in v0.9.0
func (*AppConfig) OnPostDBUpdate ¶ added in v0.9.0
func (*AppConfig) OnPostResolve ¶ added in v0.9.0
func (*AppConfig) OnPreDBCreate ¶ added in v0.9.0
func (*AppConfig) OnPreDBDelete ¶ added in v0.9.0
func (*AppConfig) OnPreDBExec ¶ added in v0.9.0
func (*AppConfig) OnPreDBQuery ¶ added in v0.9.0
func (*AppConfig) OnPreDBUpdate ¶ added in v0.9.0
func (*AppConfig) OnPreResolve ¶ added in v0.9.0
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) Config ¶
Config allows plugins to update the app configuration before initialization
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin( app AppLike, pluginDir string, runtimeSetupFunc func(rt *qjs.Runtime, inPool bool) error, qjsWasmBytes []byte, ) (p *Plugin, err error)
NewPlugin creates a new plugin instance
- app: the fastschema app instance
- dir: the relative path to the plugin directory
func (*Plugin) EvalPluginFile ¶ added in v0.9.0
func (*Plugin) InvokeJsFunc ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.