control

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	Config    config.IConfig
	TplEngine *template.TplEngine
	Module    string
	Namespace string
	Actions   map[string]func()
	W         http.ResponseWriter
	R         *http.Request
	Header    map[string]string
}

func NewControl

func NewControl(config config.IConfig, w http.ResponseWriter, r *http.Request) *Control

func (*Control) Display

func (c *Control) Display(tpl string)

func (*Control) GetInt

func (c *Control) GetInt(name string) int

func (*Control) GetString

func (c *Control) GetString(name string) string

func (*Control) Index

func (c *Control) Index()

func (*Control) PostInt

func (c *Control) PostInt(name string) int

func (*Control) PostString

func (c *Control) PostString(name string) string

func (*Control) Register

func (c *Control) Register(action string, f func()) *Control

func (*Control) Response

func (c *Control) Response(code int, result interface{}, message string)

func (*Control) ResponseWithHeader

func (c *Control) ResponseWithHeader(code int, result interface{}, message string)

func (*Control) Run

func (c *Control) Run(action string)

type CtlDefault

type CtlDefault struct {
	Control
}

func NewCtlDefault

func NewCtlDefault(config config.IConfig, w http.ResponseWriter, r *http.Request) *CtlDefault

func (*CtlDefault) Index

func (this *CtlDefault) Index()

type CtlIndex

type CtlIndex struct {
	Control
}

func NewCtlIndex

func NewCtlIndex(config config.IConfig, w http.ResponseWriter, r *http.Request) *CtlIndex

func (*CtlIndex) Index

func (this *CtlIndex) Index()

type CtlLogin

type CtlLogin struct {
	Control
}

func NewCtlLogin

func NewCtlLogin(config config.IConfig, w http.ResponseWriter, r *http.Request) *CtlLogin

func (*CtlLogin) Index

func (this *CtlLogin) Index()

type IControl

type IControl interface {
	Register(string, func()) *Control
	Run(string)
	ResponseWithHeader(int, interface{}, string)
	Response(int, interface{}, string)
	Display(string)
}

Jump to

Keyboard shortcuts

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