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

package adapter

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

Index

Package Files

adapter.go

type BaseAdapter Uses

type BaseAdapter struct {
    // contains filtered or unexported fields
}

BaseAdapter is a base adapter contains some helper functions.

func (*BaseAdapter) CookieKey Uses

func (base *BaseAdapter) CookieKey() string

CookieKey return the cookie key.

func (*BaseAdapter) GetConnection Uses

func (base *BaseAdapter) GetConnection() db.Connection

GetConnection get the db connection.

func (*BaseAdapter) GetContent Uses

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 Uses

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 Uses

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 Uses

func (base *BaseAdapter) HTMLContentType() string

HTMLContentType return the default content type header.

func (*BaseAdapter) SetConnection Uses

func (base *BaseAdapter) SetConnection(conn db.Connection)

SetConnection set the db connection.

type WebFrameWork Uses

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

Directories

PathSynopsis
beego
buffalo
chi
echo
fasthttp
gf
gin
gorilla
iris

Package adapter imports 14 packages (graph) and is imported by 11 packages. Updated 2020-07-03. Refresh now. Tools for package owners.