engine

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 18 Imported by: 232

Documentation

Index

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.

func Register

func Register(ada adapter.WebFrameWork)

Register set default adapter of engine.

func User added in v1.1.2

func User(ci interface{}) (models.UserModel, bool)

User call the User method of defaultAdapter.

Types

type ConnectionSetter added in v1.1.2

type ConnectionSetter func(db.Connection)

type Engine

type Engine struct {
	PluginList []plugins.Plugin
	Adapter    adapter.WebFrameWork
	Services   service.List
	NavButtons []types.Button
	// 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 Default

func Default() *Engine

Default return the default engine instance.

func (*Engine) AddAdapter

func (eng *Engine) AddAdapter(ada adapter.WebFrameWork) *Engine

AddAdapter add the adapter of engine.

func (*Engine) AddAuthService added in v1.1.8

func (eng *Engine) AddAuthService(processor auth.Processor) *Engine

func (*Engine) AddConfig

func (eng *Engine) AddConfig(cfg config.Config) *Engine

AddConfig set the global config.

func (*Engine) AddConfigFromINI added in v1.1.4

func (eng *Engine) AddConfigFromINI(path string) *Engine

AddConfigFromINI set the global config from ini file.

func (*Engine) AddConfigFromJSON added in v1.0.8

func (eng *Engine) AddConfigFromJSON(path string) *Engine

AddConfigFromJSON set the global config from json file.

func (*Engine) AddConfigFromYAML added in v1.1.4

func (eng *Engine) AddConfigFromYAML(path string) *Engine

AddConfigFromYAML set the global config from yaml file.

func (*Engine) AddDisplayFilterLimit added in v1.2.7

func (eng *Engine) AddDisplayFilterLimit(limit int) *Engine

AddDisplayFilterLimit call types.AddDisplayFilterLimit

func (*Engine) AddDisplayFilterSubstr added in v1.2.7

func (eng *Engine) AddDisplayFilterSubstr(start int, end int) *Engine

AddDisplayFilterSubstr call types.AddDisplayFilterSubstr

func (*Engine) AddDisplayFilterToLower added in v1.2.7

func (eng *Engine) AddDisplayFilterToLower() *Engine

AddDisplayFilterToLower call types.AddDisplayFilterToLower

func (*Engine) AddDisplayFilterToTitle added in v1.2.7

func (eng *Engine) AddDisplayFilterToTitle() *Engine

AddDisplayFilterToTitle call types.AddDisplayFilterToTitle

func (*Engine) AddDisplayFilterToUpper added in v1.2.7

func (eng *Engine) AddDisplayFilterToUpper() *Engine

AddDisplayFilterToUpper call types.AddDisplayFilterToUpper

func (*Engine) AddDisplayFilterTrimSpace added in v1.2.7

func (eng *Engine) AddDisplayFilterTrimSpace() *Engine

AddDisplayFilterTrimSpace call types.AddDisplayFilterTrimSpace

func (*Engine) AddDisplayFilterXssFilter added in v1.2.7

func (eng *Engine) AddDisplayFilterXssFilter() *Engine

AddDisplayFilterXssFilter call types.AddDisplayFilterXssFilter

func (*Engine) AddDisplayFilterXssJsFilter added in v1.2.7

func (eng *Engine) AddDisplayFilterXssJsFilter() *Engine

AddDisplayFilterXssJsFilter call types.AddDisplayFilterXssJsFilter

func (*Engine) AddGenerator added in v1.2.7

func (eng *Engine) AddGenerator(key string, g table.Generator) *Engine

AddGenerator add table model generator.

func (*Engine) AddGenerators added in v1.2.7

func (eng *Engine) AddGenerators(list ...table.GeneratorList) *Engine

func (*Engine) AddGlobalDisplayProcessFn added in v1.2.7

func (eng *Engine) AddGlobalDisplayProcessFn(f types.DisplayProcessFn) *Engine

AddGlobalDisplayProcessFn call types.AddGlobalDisplayProcessFn

func (*Engine) AddNavButtons added in v1.2.7

func (eng *Engine) AddNavButtons(title template2.HTML, icon string, action types.Action) *Engine

func (*Engine) AddPlugins

func (eng *Engine) AddPlugins(plugs ...plugins.Plugin) *Engine

AddPlugins add the plugins and initialize them.

func (*Engine) AdminPlugin added in v1.2.7

func (eng *Engine) AdminPlugin() *admin.Admin

func (*Engine) Clone added in v1.1.2

func (eng *Engine) Clone(e *Engine) *Engine

func (*Engine) ClonedBySetter added in v1.1.2

func (eng *Engine) ClonedBySetter(setter Setter) *Engine

func (*Engine) Content added in v1.1.2

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.1.2

func (eng *Engine) DB(driver string) db.Connection

db return the db connection of given driver.

func (*Engine) Data added in v1.2.5

func (eng *Engine) Data(method, url string, handler context.Handler)

func (*Engine) DefaultConnection added in v1.1.7

func (eng *Engine) DefaultConnection() db.Connection

func (*Engine) FindPluginByName added in v1.2.7

func (eng *Engine) FindPluginByName(name string) (plugins.Plugin, bool)

func (*Engine) HTML added in v1.2.5

func (eng *Engine) HTML(method, url string, fn types.GetPanelInfoFn)

func (*Engine) HTMLFile added in v1.2.5

func (eng *Engine) HTMLFile(method, url, path string, data map[string]interface{})

func (*Engine) HTMLFiles added in v1.2.5

func (eng *Engine) HTMLFiles(method, url string, data map[string]interface{}, files ...string)

func (*Engine) InitDatabase added in v1.1.2

func (eng *Engine) InitDatabase() *Engine

InitDatabase initialize all database connection.

func (*Engine) MssqlConnection added in v1.1.2

func (eng *Engine) MssqlConnection() db.Connection

MssqlConnection return the mssql db connection of given driver.

func (*Engine) MysqlConnection added in v1.1.2

func (eng *Engine) MysqlConnection() db.Connection

MysqlConnection return the mysql db connection of given driver.

func (*Engine) PostgresqlConnection added in v1.1.2

func (eng *Engine) PostgresqlConnection() db.Connection

PostgresqlConnection return the postgresql db connection of given driver.

func (*Engine) ResolveConnection added in v1.1.2

func (eng *Engine) ResolveConnection(setter ConnectionSetter, driver string) *Engine

func (*Engine) ResolveMssqlConnection added in v1.1.2

func (eng *Engine) ResolveMssqlConnection(setter ConnectionSetter) *Engine

func (*Engine) ResolveMysqlConnection added in v1.1.2

func (eng *Engine) ResolveMysqlConnection(setter ConnectionSetter) *Engine

func (*Engine) ResolvePostgresqlConnection added in v1.1.2

func (eng *Engine) ResolvePostgresqlConnection(setter ConnectionSetter) *Engine

func (*Engine) ResolveSqliteConnection added in v1.1.2

func (eng *Engine) ResolveSqliteConnection(setter ConnectionSetter) *Engine

func (*Engine) SqliteConnection added in v1.1.2

func (eng *Engine) SqliteConnection() db.Connection

SqliteConnection return the sqlite db connection of given driver.

func (*Engine) Use

func (eng *Engine) Use(router interface{}) error

Use enable the adapter.

func (*Engine) User added in v1.1.2

func (eng *Engine) User(ci interface{}) (models.UserModel, bool)

User call the User method of engine adapter.

type Setter added in v1.1.2

type Setter func(*Engine)

Jump to

Keyboard shortcuts

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