app

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 10 Imported by: 83

README

app-starter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCache added in v1.4.0

func GetCache() (c cache.C)

func GetOrm

func GetOrm() *persistence.OrmContext

Types

type Application

type Application interface {
	Start(buildHandler func(ctx context.Context, builder *ApplicationBuilder) error, onTerminate func(string)) error
}

func New

func New() (instance Application)

type ApplicationBuilder added in v1.2.1

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

func (*ApplicationBuilder) ComponentAfter added in v1.2.1

func (h *ApplicationBuilder) ComponentAfter(component func(context.Context) (err error)) *ApplicationBuilder

func (*ApplicationBuilder) ComponentBefore added in v1.2.1

func (h *ApplicationBuilder) ComponentBefore(component func(context.Context) (err error)) *ApplicationBuilder

func (*ApplicationBuilder) EnableCache added in v1.4.0

func (h *ApplicationBuilder) EnableCache(redisOpts cache.RedisOptions, cacheOpts cache.Options) *ApplicationBuilder

func (*ApplicationBuilder) EnableDatabase added in v1.2.1

func (h *ApplicationBuilder) EnableDatabase(config persistence.BaseConfig,
	models ...interface{}) *ApplicationBuilder

func (*ApplicationBuilder) EnableStaticWeb added in v1.2.1

func (h *ApplicationBuilder) EnableStaticWeb(vdir, home string,
	assetInfo func(name string) (os.FileInfo, error),
	asset func(string) ([]byte, error),
	assetNames func() []string) *ApplicationBuilder

func (*ApplicationBuilder) EnableWeb added in v1.2.1

func (h *ApplicationBuilder) EnableWeb(listen string, components ...server.Component) *ApplicationBuilder

func (*ApplicationBuilder) HealthyHandler added in v1.5.0

func (h *ApplicationBuilder) HealthyHandler(handler func() int) *ApplicationBuilder

func (*ApplicationBuilder) LoadConfig added in v1.2.1

func (h *ApplicationBuilder) LoadConfig(config interface{}, callback func(etc.Loader)) (err error)

func (*ApplicationBuilder) ReadyHandler added in v1.5.0

func (h *ApplicationBuilder) ReadyHandler(handler func() int) *ApplicationBuilder

func (*ApplicationBuilder) SetMonitorPrefix added in v1.5.0

func (h *ApplicationBuilder) SetMonitorPrefix(prefix string) *ApplicationBuilder

func (*ApplicationBuilder) SetWebLogLevel added in v1.3.3

func (h *ApplicationBuilder) SetWebLogLevel(lvl string) *ApplicationBuilder

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