api

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 IApi

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

func NewIApi

func NewIApi(config config.IConfig, w http.ResponseWriter, r *http.Request) *IApi

func (*IApi) GetInt

func (i *IApi) GetInt(name string) int

func (*IApi) GetString

func (i *IApi) GetString(name string) string

func (*IApi) Index

func (c *IApi) Index()

func (*IApi) PostInt

func (i *IApi) PostInt(name string) int

func (*IApi) PostString

func (i *IApi) PostString(name string) string

func (*IApi) Register

func (i *IApi) Register(action string, f func()) *IApi

func (*IApi) Response

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

func (*IApi) ResponseWithHeader

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

func (*IApi) Run

func (i *IApi) Run(action string)

type IBase

type IBase struct {
	IApi
}

base interface

func NewIBase

func NewIBase(config config.IConfig, w http.ResponseWriter, r *http.Request) *IBase

type ILogin

type ILogin struct {
	IApi
}

func NewILogin

func NewILogin(config config.IConfig, w http.ResponseWriter, r *http.Request) *ILogin

func (*ILogin) Index

func (this *ILogin) Index()

type IUser

type IUser struct {
	IApi
}

func NewIUser

func NewIUser(config config.IConfig, w http.ResponseWriter, r *http.Request) *IUser

func (*IUser) Create

func (this *IUser) Create()

@todo 用户创建

func (*IUser) Index

func (this *IUser) Index()

Jump to

Keyboard shortcuts

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