app

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 6 Imported by: 83

README

app-starter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrm

func GetOrm() *persistence.OrmContext

Types

type Application

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

func New

func New(ctx context.Context) (instance *Application)

func (*Application) EnableDatabase

func (a *Application) EnableDatabase(config persistence.BaseConfig, models ...interface{}) *Application

func (*Application) EnableStaticWeb added in v1.0.2

func (a *Application) EnableStaticWeb(home string, asset func(string) ([]byte, error), assetNames func() []string) *Application

func (*Application) EnableWeb

func (a *Application) EnableWeb(listen string, components ...server.Component) *Application

func (*Application) LoadConfig

func (a *Application) LoadConfig(config interface{}, name string, path ...string) error

func (*Application) Start

func (a *Application) Start() (err error)

type Pager added in v1.1.3

type Pager struct {
	TotalPage int           `json:"totalPage"` // 总页数
	PageSize  int           `json:"pageSize"`  // 页面大小
	PageNum   int           `json:"pageNum"`   // 页号
	More      int           `json:"more"`      // 是否有下一页
	Data      []interface{} `json:"items,omitempty"`
}

type PagerResponse added in v1.1.3

type PagerResponse struct {
	Response
	Pager
}

type Response added in v1.1.3

type Response struct {
	Code    interface{} `json:"code,omitempty"`
	Success interface{} `json:"success,omitempty"`
	Message string      `json:"message,omitempty"`
}

func (*Response) SetCode added in v1.1.3

func (r *Response) SetCode(code int) *Response

func (*Response) SetSuccess added in v1.1.3

func (r *Response) SetSuccess(success bool) *Response

Directories

Path Synopsis
application
api

Jump to

Keyboard shortcuts

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