Documentation ¶
Index ¶
- type BaseAdapter
- func (base *BaseAdapter) CookieKey() string
- func (base *BaseAdapter) GetConnection() db.Connection
- func (base *BaseAdapter) GetContent(ctx interface{}, getPanelFn types.GetPanelFn, wf WebFrameWork, ...)
- func (base *BaseAdapter) GetUse(app interface{}, plugin []plugins.Plugin, wf WebFrameWork) error
- func (base *BaseAdapter) GetUser(ctx interface{}, wf WebFrameWork) (models.UserModel, bool)
- func (base *BaseAdapter) HTMLContentType() string
- func (base *BaseAdapter) SetConnection(conn db.Connection)
- type WebFrameWork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseAdapter ¶ added in v1.2.23
type BaseAdapter struct {
// contains filtered or unexported fields
}
BaseAdapter is a base adapter contains some helper functions.
func (*BaseAdapter) CookieKey ¶ added in v1.2.23
func (base *BaseAdapter) CookieKey() string
CookieKey return the cookie key.
func (*BaseAdapter) GetConnection ¶ added in v1.2.23
func (base *BaseAdapter) GetConnection() db.Connection
GetConnection get the db connection.
func (*BaseAdapter) GetContent ¶ added in v1.2.23
func (base *BaseAdapter) GetContent(ctx interface{}, getPanelFn types.GetPanelFn, wf WebFrameWork, navButtons types.Buttons, fn context.NodeProcessor)
GetContent is a helper function of adapter.Content
func (*BaseAdapter) GetUse ¶ added in v1.2.23
func (base *BaseAdapter) GetUse(app interface{}, plugin []plugins.Plugin, wf WebFrameWork) error
GetUse is a helper function adds the plugins to the framework.
func (*BaseAdapter) GetUser ¶ added in v1.2.23
func (base *BaseAdapter) GetUser(ctx interface{}, wf WebFrameWork) (models.UserModel, bool)
GetUser is a helper function get the auth user model from the context.
func (*BaseAdapter) HTMLContentType ¶ added in v1.2.23
func (base *BaseAdapter) HTMLContentType() string
HTMLContentType return the default content type header.
func (*BaseAdapter) SetConnection ¶ added in v1.2.23
func (base *BaseAdapter) SetConnection(conn db.Connection)
SetConnection set the db connection.
type WebFrameWork ¶
type WebFrameWork interface { // Name return the web framework name. Name() string // Use method inject the plugins to the web framework engine which is the // first parameter. Use(app interface{}, plugins []plugins.Plugin) error // Content add the panel html response of the given callback function to // the web framework context which is the first parameter. Content(ctx interface{}, fn types.GetPanelFn, fn2 context.NodeProcessor, navButtons ...types.Button) // User get the auth user model from the given web framework context. User(ctx interface{}) (models.UserModel, bool) // AddHandler inject the route and handlers of GoAdmin to the web framework. AddHandler(method, path string, handlers context.Handlers) DisableLog() Static(prefix, path string) Run() error SetApp(app interface{}) error SetConnection(db.Connection) GetConnection() db.Connection SetContext(ctx interface{}) WebFrameWork GetCookie() (string, error) Lang() string Path() string Method() string FormParam() url.Values IsPjax() bool Redirect() SetContentType() Write(body []byte) CookieKey() string HTMLContentType() string }
WebFrameWork is an interface which is used as an adapter of framework and goAdmin. It must implement two methods. Use registers the routes and the corresponding handlers. Content writes the response to the corresponding context of framework.