Documentation ¶
Index ¶
- func Content(ctx interface{}, panel types.GetPanelFn)
- func Register(ada adapter.WebFrameWork)
- func User(ctx interface{}) (models.UserModel, bool)
- type ConnectionSetter
- type Engine
- func (eng *Engine) AddAdapter(ada adapter.WebFrameWork) *Engine
- func (eng *Engine) AddAuthService(processor auth.Processor) *Engine
- func (eng *Engine) AddConfig(cfg *config.Config) *Engine
- func (eng *Engine) AddConfigFromINI(path string) *Engine
- func (eng *Engine) AddConfigFromJSON(path string) *Engine
- func (eng *Engine) AddConfigFromYAML(path string) *Engine
- func (eng *Engine) AddDisplayFilterLimit(limit int) *Engine
- func (eng *Engine) AddDisplayFilterSubstr(start int, end int) *Engine
- func (eng *Engine) AddDisplayFilterToLower() *Engine
- func (eng *Engine) AddDisplayFilterToTitle() *Engine
- func (eng *Engine) AddDisplayFilterToUpper() *Engine
- func (eng *Engine) AddDisplayFilterTrimSpace() *Engine
- func (eng *Engine) AddDisplayFilterXssFilter() *Engine
- func (eng *Engine) AddDisplayFilterXssJsFilter() *Engine
- func (eng *Engine) AddGenerator(key string, g table.Generator) *Engine
- func (eng *Engine) AddGenerators(list ...table.GeneratorList) *Engine
- func (eng *Engine) AddGlobalDisplayProcessFn(f types.FieldFilterFn) *Engine
- func (eng *Engine) AddNavButtons(title template2.HTML, icon string, action types.Action) *Engine
- func (eng *Engine) AddNavButtonsRaw(btns ...types.Button) *Engine
- func (eng *Engine) AddPluginList(plugs plugins.Plugins) *Engine
- func (eng *Engine) AddPlugins(plugs ...plugins.Plugin) *Engine
- func (eng *Engine) AdminPlugin() *admin.Admin
- func (eng *Engine) Clone(e *Engine) *Engine
- func (eng *Engine) ClonedBySetter(setter Setter) *Engine
- func (eng *Engine) Content(ctx interface{}, panel types.GetPanelFn)
- func (eng *Engine) DB(driver string) db.Connection
- func (eng *Engine) Data(method, url string, handler context.Handler, noAuth ...bool)
- func (eng *Engine) DefaultConnection() db.Connection
- func (eng *Engine) FindPluginByName(name string) (plugins.Plugin, bool)
- func (eng *Engine) HTML(method, url string, fn types.GetPanelInfoFn, noAuth ...bool)
- func (eng *Engine) HTMLFile(method, url, path string, data map[string]interface{}, noAuth ...bool)
- func (eng *Engine) HTMLFiles(method, url string, data map[string]interface{}, files ...string)
- func (eng *Engine) HTMLFilesNoAuth(method, url string, data map[string]interface{}, files ...string)
- func (eng *Engine) MssqlConnection() db.Connection
- func (eng *Engine) MysqlConnection() db.Connection
- func (eng *Engine) OceanBaseConnection() db.Connection
- func (eng *Engine) PostgresqlConnection() db.Connection
- func (eng *Engine) ResolveConnection(setter ConnectionSetter, driver string) *Engine
- func (eng *Engine) ResolveMssqlConnection(setter ConnectionSetter) *Engine
- func (eng *Engine) ResolveMysqlConnection(setter ConnectionSetter) *Engine
- func (eng *Engine) ResolvePostgresqlConnection(setter ConnectionSetter) *Engine
- func (eng *Engine) ResolveSqliteConnection(setter ConnectionSetter) *Engine
- func (eng *Engine) SetCaptcha(captcha map[string]string) *Engine
- func (eng *Engine) SetCaptchaDriver(driver string) *Engine
- func (eng *Engine) SqliteConnection() db.Connection
- func (eng *Engine) Use(router interface{}) error
- func (eng *Engine) User(ctx interface{}) (models.UserModel, bool)
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Content ¶
func Content(ctx interface{}, panel types.GetPanelFn)
Content call the Content method of defaultAdapter. If defaultAdapter is nil, it will panic.
Types ¶
type ConnectionSetter ¶ added in v1.3.0
type ConnectionSetter func(db.Connection)
type Engine ¶
type Engine struct { PluginList plugins.Plugins Adapter adapter.WebFrameWork Services service.List // contains filtered or unexported fields }
Engine is the core component of goAdmin. It has two attributes. PluginList is an array of plugin. Adapter is the adapter of web framework context and goAdmin context. The relationship of adapter and plugin is that the adapter use the plugin which contains routers and controller methods to inject into the framework entity and make it work.
func (*Engine) AddAdapter ¶
func (eng *Engine) AddAdapter(ada adapter.WebFrameWork) *Engine
AddAdapter add the adapter of engine.
func (*Engine) AddAuthService ¶ added in v1.3.0
AddAuthService customize the auth logic with given callback function.
func (*Engine) AddConfigFromINI ¶ added in v1.3.0
AddConfigFromINI set the global config from ini file.
func (*Engine) AddConfigFromJSON ¶ added in v1.3.0
AddConfigFromJSON set the global config from json file.
func (*Engine) AddConfigFromYAML ¶ added in v1.3.0
AddConfigFromYAML set the global config from yaml file.
func (*Engine) AddDisplayFilterLimit ¶ added in v1.3.0
AddDisplayFilterLimit call types.AddDisplayFilterLimit.
func (*Engine) AddDisplayFilterSubstr ¶ added in v1.3.0
AddDisplayFilterSubstr call types.AddDisplayFilterSubstr.
func (*Engine) AddDisplayFilterToLower ¶ added in v1.3.0
AddDisplayFilterToLower call types.AddDisplayFilterToLower.
func (*Engine) AddDisplayFilterToTitle ¶ added in v1.3.0
AddDisplayFilterToTitle call types.AddDisplayFilterToTitle.
func (*Engine) AddDisplayFilterToUpper ¶ added in v1.3.0
AddDisplayFilterToUpper call types.AddDisplayFilterToUpper.
func (*Engine) AddDisplayFilterTrimSpace ¶ added in v1.3.0
AddDisplayFilterTrimSpace call types.AddDisplayFilterTrimSpace.
func (*Engine) AddDisplayFilterXssFilter ¶ added in v1.3.0
AddDisplayFilterXssFilter call types.AddDisplayFilterXssFilter.
func (*Engine) AddDisplayFilterXssJsFilter ¶ added in v1.3.0
AddDisplayFilterXssJsFilter call types.AddDisplayFilterXssJsFilter.
func (*Engine) AddGenerator ¶ added in v1.3.0
AddGenerator add table model generator.
func (*Engine) AddGenerators ¶ added in v1.3.0
func (eng *Engine) AddGenerators(list ...table.GeneratorList) *Engine
AddGenerators add the admin generators.
func (*Engine) AddGlobalDisplayProcessFn ¶ added in v1.3.0
func (eng *Engine) AddGlobalDisplayProcessFn(f types.FieldFilterFn) *Engine
AddGlobalDisplayProcessFn call types.AddGlobalDisplayProcessFn.
func (*Engine) AddNavButtons ¶ added in v1.3.0
AddNavButtons add the nav buttons.
func (*Engine) AddNavButtonsRaw ¶ added in v1.3.0
AddNavButtonsRaw add the nav buttons.
func (*Engine) AddPluginList ¶ added in v1.3.0
AddPluginList add the plugins
func (*Engine) AddPlugins ¶
AddPlugins add the plugins
func (*Engine) AdminPlugin ¶ added in v1.3.0
AdminPlugin get the admin plugin. if not exist, create one.
func (*Engine) ClonedBySetter ¶ added in v1.3.0
ClonedBySetter copy a new Engine by a setter callback function.
func (*Engine) Content ¶ added in v1.3.0
func (eng *Engine) Content(ctx interface{}, panel types.GetPanelFn)
Content call the Content method of engine adapter. If adapter is nil, it will panic.
func (*Engine) DB ¶ added in v1.3.0
func (eng *Engine) DB(driver string) db.Connection
DB return the db connection of given driver.
func (*Engine) Data ¶ added in v1.3.0
Data inject the route and corresponding handler to the web framework.
func (*Engine) DefaultConnection ¶ added in v1.3.0
func (eng *Engine) DefaultConnection() db.Connection
DefaultConnection return the default db connection.
func (*Engine) FindPluginByName ¶ added in v1.3.0
FindPluginByName find the register plugin by given name.
func (*Engine) HTML ¶ added in v1.3.0
func (eng *Engine) HTML(method, url string, fn types.GetPanelInfoFn, noAuth ...bool)
HTML inject the route and corresponding handler wrapped by the given function to the web framework.
func (*Engine) HTMLFile ¶ added in v1.3.0
HTMLFile inject the route and corresponding handler which returns the panel content of given html file path to the web framework.
func (*Engine) HTMLFiles ¶ added in v1.3.0
HTMLFiles inject the route and corresponding handler which returns the panel content of given html files path to the web framework.
func (*Engine) HTMLFilesNoAuth ¶ added in v1.3.0
func (eng *Engine) HTMLFilesNoAuth(method, url string, data map[string]interface{}, files ...string)
HTMLFilesNoAuth inject the route and corresponding handler which returns the panel content of given html files path to the web framework without auth check.
func (*Engine) MssqlConnection ¶ added in v1.3.0
func (eng *Engine) MssqlConnection() db.Connection
MssqlConnection return the mssql db connection of given driver.
func (*Engine) MysqlConnection ¶ added in v1.3.0
func (eng *Engine) MysqlConnection() db.Connection
MysqlConnection return the mysql db connection of given driver.
func (*Engine) OceanBaseConnection ¶ added in v1.3.0
func (eng *Engine) OceanBaseConnection() db.Connection
OceanBaseConnection return the OceanBase db connection of given driver.
func (*Engine) PostgresqlConnection ¶ added in v1.3.0
func (eng *Engine) PostgresqlConnection() db.Connection
PostgresqlConnection return the postgresql db connection of given driver.
func (*Engine) ResolveConnection ¶ added in v1.3.0
func (eng *Engine) ResolveConnection(setter ConnectionSetter, driver string) *Engine
ResolveConnection resolve the specified driver connection.
func (*Engine) ResolveMssqlConnection ¶ added in v1.3.0
func (eng *Engine) ResolveMssqlConnection(setter ConnectionSetter) *Engine
ResolveMssqlConnection resolve the mssql connection.
func (*Engine) ResolveMysqlConnection ¶ added in v1.3.0
func (eng *Engine) ResolveMysqlConnection(setter ConnectionSetter) *Engine
ResolveMysqlConnection resolve the mysql connection.
func (*Engine) ResolvePostgresqlConnection ¶ added in v1.3.0
func (eng *Engine) ResolvePostgresqlConnection(setter ConnectionSetter) *Engine
ResolvePostgresqlConnection resolve the postgres connection.
func (*Engine) ResolveSqliteConnection ¶ added in v1.3.0
func (eng *Engine) ResolveSqliteConnection(setter ConnectionSetter) *Engine
ResolveSqliteConnection resolve the sqlite connection.
func (*Engine) SetCaptcha ¶ added in v1.3.0
SetCaptcha set the captcha config.
func (*Engine) SetCaptchaDriver ¶ added in v1.3.0
SetCaptchaDriver set the captcha config with driver.
func (*Engine) SqliteConnection ¶ added in v1.3.0
func (eng *Engine) SqliteConnection() db.Connection
SqliteConnection return the sqlite db connection of given driver.