app

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package app 生成swagger文档

文档规则请参考:https://github.com/swaggo/swag#declarative-comments-format

使用方式:

go get -u github.com/swaggo/swag/cmd/swag
swag init --parseDependency --generalInfo ./internal/app/swagger.go --output ./internal/app/swagger

Index

Constants

This section is empty.

Variables

View Source
var InjectorSet = wire.NewSet(wire.Struct(new(Injector), "*"))

InjectorSet 注入Injector

Functions

func Init

func Init(ctx context.Context, opts ...Option) (func(), error)

Init 应用初始化

func InitGinEngine

func InitGinEngine(r router.IRouter) *gin.Engine

InitGinEngine 初始化gin引擎

func InitHTTPServer

func InitHTTPServer(ctx context.Context, handler http.Handler) func()

InitHTTPServer 初始化http服务

func InitLogger

func InitLogger() (func(), error)

InitLogger 初始化日志模块

func InitMonitor

func InitMonitor(ctx context.Context) func()

InitMonitor 初始化服务监控

func Run

func Run(ctx context.Context, opts ...Option) error

Run 运行服务

Types

type Injector

type Injector struct {
	Engine *gin.Engine
}

Injector 注入器(用于初始化完成之后的引用)

func BuildInjector

func BuildInjector() (*Injector, func(), error)

type Option

type Option func(*options)

Option 定义配置项

func SetConfigFile

func SetConfigFile(s string) Option

SetConfigFile 设定配置文件

func SetVersion

func SetVersion(s string) Option

SetVersion 设定版本号

Directories

Path Synopsis
api
Package test 接口测试 使用方式: go test -v
Package test 接口测试 使用方式: go test -v

Jump to

Keyboard shortcuts

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