controller

package
v0.0.0-...-62da3de Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"

Variables

This section is empty.

Functions

func NewControllerSingleFlight

func NewControllerSingleFlight() eudore.Controller

func NewPairs

func NewPairs(keys []string) *pairs

Types

type Call

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

Call 代表需要被执行的函数

type ControllerSingleFlight

type ControllerSingleFlight struct {
	eudore.ContextData
	// contains filtered or unexported fields
}

func (*ControllerSingleFlight) ControllerRoute

func (ctl *ControllerSingleFlight) ControllerRoute() map[string]string

ControllerRoute 方法返回默认路由信息。

func (*ControllerSingleFlight) Do

func (ctl *ControllerSingleFlight) Do(fn func() (interface{}, error)) (interface{}, error)

func (*ControllerSingleFlight) DoWithKey

func (ctl *ControllerSingleFlight) DoWithKey(key string, fn func() (interface{}, error)) (interface{}, error)

func (*ControllerSingleFlight) GetRouteParam

func (ctl *ControllerSingleFlight) GetRouteParam(pkg, name, method string) string

GetRouteParam 方法添加路由参数信息。

func (*ControllerSingleFlight) Init

func (ctl *ControllerSingleFlight) Init(ctx eudore.Context) error

Init 实现控制器初始方法。

func (*ControllerSingleFlight) Inject

func (ctl *ControllerSingleFlight) Inject(controller eudore.Controller, router eudore.RouterMethod) error

Inject 方法实现控制器注入到路由器的方法。

func (*ControllerSingleFlight) Release

func (ctl *ControllerSingleFlight) Release() error

Release 实现控制器释放方法。

type ControllerStatic

type ControllerStatic struct {
	eudore.Context
	Hook StaticHook

	Meta []HeadLabel
	// contains filtered or unexported fields
}

func NewControllerStatic

func NewControllerStatic() *ControllerStatic

func (*ControllerStatic) AddLabel

func (ctl *ControllerStatic) AddLabel(str string)

func (*ControllerStatic) AddMeta

func (ctl *ControllerStatic) AddMeta(name, content string)

func (*ControllerStatic) Clone

func (ctl *ControllerStatic) Clone() *ControllerStatic

func (*ControllerStatic) GetPathBody

func (ctl *ControllerStatic) GetPathBody(path string) (io.ReadCloser, error)

func (*ControllerStatic) GetSha512Value

func (ctl *ControllerStatic) GetSha512Value(path string) (string, error)

计算SRI512

func (*ControllerStatic) Init

func (ctl *ControllerStatic) Init(ctx eudore.Context) error

func (*ControllerStatic) NewHTMLHandlerFunc

func (ctl *ControllerStatic) NewHTMLHandlerFunc(path string) eudore.HandlerFunc

func (*ControllerStatic) NewMergeFileHandlerFunc

func (ctl *ControllerStatic) NewMergeFileHandlerFunc(parent string) eudore.HandlerFunc

func (*ControllerStatic) NewStaticHandlerFunc

func (ctl *ControllerStatic) NewStaticHandlerFunc(perfix string) eudore.HandlerFunc

func (*ControllerStatic) OpenMergeFile

func (ctl *ControllerStatic) OpenMergeFile(path string) (*MergeFile, error)

func (*ControllerStatic) PushAll

func (ctl *ControllerStatic) PushAll(path string) error

func (*ControllerStatic) WithPushHook

func (ctl *ControllerStatic) WithPushHook()

func (*ControllerStatic) WithSRIHook

func (ctl *ControllerStatic) WithSRIHook()

func (*ControllerStatic) WriteHTML

func (ctl *ControllerStatic) WriteHTML(path string) error

type ControllerWebsite

type ControllerWebsite struct {
	eudore.ContextData
	*sql.DB
}

func NewControllerWejass

func NewControllerWejass(db *sql.DB) *ControllerWebsite

func (*ControllerWebsite) ControllerRoute

func (ctl *ControllerWebsite) ControllerRoute() map[string]string

ControllerRoute 方法返回默认路由信息。

func (*ControllerWebsite) Exec

func (ctl *ControllerWebsite) Exec(query string, args ...interface{}) (sql.Result, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.

func (*ControllerWebsite) ExecBodyWithJSON

func (ctl *ControllerWebsite) ExecBodyWithJSON(sql string, keys ...string) error

func (*ControllerWebsite) GetRouteParam

func (ctl *ControllerWebsite) GetRouteParam(pkg, name, method string) string

GetRouteParam 方法添加路由参数信息。

func (*ControllerWebsite) Init

func (ctl *ControllerWebsite) Init(ctx eudore.Context) error

Init 实现控制器初始方法。

func (*ControllerWebsite) Inject

func (ctl *ControllerWebsite) Inject(controller eudore.Controller, router eudore.RouterMethod) error

Inject 方法实现控制器注入到路由器的方法,调用ControllerBaseInject方法注入。

func (*ControllerWebsite) QueryBind

func (ctl *ControllerWebsite) QueryBind(data interface{}, query string, args ...interface{}) error

func (*ControllerWebsite) QueryBindContext

func (ctl *ControllerWebsite) QueryBindContext(ctx context.Context, data interface{}, query string, args ...interface{}) error

func (*ControllerWebsite) QueryCount

func (ctl *ControllerWebsite) QueryCount(query string, args ...interface{}) int

QueryCount

func (*ControllerWebsite) QueryCountContext

func (ctl *ControllerWebsite) QueryCountContext(ctx context.Context, query string, args ...interface{}) int

QueryCountContext

func (*ControllerWebsite) QueryJSON

func (ctl *ControllerWebsite) QueryJSON(query string, args ...interface{}) (map[string]interface{}, error)

func (*ControllerWebsite) QueryJSONContext

func (ctl *ControllerWebsite) QueryJSONContext(ctx context.Context, query string, args ...interface{}) (map[string]interface{}, error)

func (*ControllerWebsite) QueryPages

func (ctl *ControllerWebsite) QueryPages(query string, args ...interface{}) ([]map[string]interface{}, error)

QueryPages 方法对查询结构分页,使用url参数size和page作为分页参数,对查询sql后附加sql: " limit %d OFFSET %d"。

func (*ControllerWebsite) QueryPagesContext

func (ctl *ControllerWebsite) QueryPagesContext(ctx context.Context, query string, args ...interface{}) ([]map[string]interface{}, error)

QueryContextPages 方法对查询结构分页,使用url参数size和page作为分页参数,对查询sql后附加sql: " limit %d OFFSET %d"。

func (*ControllerWebsite) QueryRows

func (ctl *ControllerWebsite) QueryRows(query string, args ...interface{}) ([]map[string]interface{}, error)

func (*ControllerWebsite) QueryRowsContext

func (ctl *ControllerWebsite) QueryRowsContext(ctx context.Context, query string, args ...interface{}) ([]map[string]interface{}, error)

func (*ControllerWebsite) Release

func (ctl *ControllerWebsite) Release() error

Release 实现控制器释放方法。

type HeadLabel

type HeadLabel interface {
	Type() string
	String() string
}

type MergeFile

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

func (*MergeFile) Close

func (mf *MergeFile) Close() error

func (*MergeFile) Read

func (mf *MergeFile) Read(p []byte) (n int, err error)

type StaticHook

type StaticHook func(*ControllerStatic, HeadLabel)

Jump to

Keyboard shortcuts

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