go-admin: github.com/GoAdminGroup/go-admin/engine Index | Files

package engine

import "github.com/GoAdminGroup/go-admin/engine"

Index

Package Files

engine.go

func Content Uses

func Content(ctx interface{}, panel types.GetPanelFn)

Content call the Content method of defaultAdapter. If defaultAdapter is nil, it will panic.

func Register Uses

func Register(ada adapter.WebFrameWork)

Register set default adapter of engine.

func User Uses

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

User call the User method of defaultAdapter.

type ConnectionSetter Uses

type ConnectionSetter func(db.Connection)

type Engine Uses

type Engine struct {
    PluginList []plugins.Plugin
    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 Default Uses

func Default() *Engine

Default return the default engine instance.

func (*Engine) AddAdapter Uses

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

AddAdapter add the adapter of engine.

func (*Engine) AddAuthService Uses

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

func (*Engine) AddConfig Uses

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

AddConfig set the global config.

func (*Engine) AddConfigFromINI Uses

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

AddConfigFromINI set the global config from ini file.

func (*Engine) AddConfigFromJSON Uses

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

AddConfigFromJSON set the global config from json file.

func (*Engine) AddConfigFromYAML Uses

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

AddConfigFromYAML set the global config from yaml file.

func (*Engine) AddPlugins Uses

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

AddPlugins add the plugins and initialize them.

func (*Engine) Clone Uses

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

func (*Engine) ClonedBySetter Uses

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

func (*Engine) Content Uses

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 Uses

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

db return the db connection of given driver.

func (*Engine) DefaultConnection Uses

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

func (*Engine) InitDatabase Uses

func (eng *Engine) InitDatabase() *Engine

InitDatabase initialize all database connection.

func (*Engine) MssqlConnection Uses

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

MssqlConnection return the mssql db connection of given driver.

func (*Engine) MysqlConnection Uses

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

MysqlConnection return the mysql db connection of given driver.

func (*Engine) PostgresqlConnection Uses

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

PostgresqlConnection return the postgresql db connection of given driver.

func (*Engine) ResolveConnection Uses

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

func (*Engine) ResolveMssqlConnection Uses

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

func (*Engine) ResolveMysqlConnection Uses

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

func (*Engine) ResolvePostgresqlConnection Uses

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

func (*Engine) ResolveSqliteConnection Uses

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

func (*Engine) SqliteConnection Uses

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

SqliteConnection return the sqlite db connection of given driver.

func (*Engine) Use Uses

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

Use enable the adapter.

func (*Engine) User Uses

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

User call the User method of engine adapter.

type Setter Uses

type Setter func(*Engine)

Package engine imports 8 packages (graph) and is imported by 34 packages. Updated 2020-01-22. Refresh now. Tools for package owners.