g

package
v0.0.0-...-61bba1b Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cfg

func Cfg(name ...string) *gcfg.Config

Cfg is alias of Config. See Config.

func DB

func DB(name ...string) gdb.DB

DB is alias of Database. See Database.

func GinEngine

func GinEngine() *gin.Engine

返回gin的Default方法,方便go-micro集成

func Server

func Server() *gins.Server

Server returns an instance of http server with specified name.

Example
// A hello world example.
s := g.Server()
s.BindHandler("/", func(r *ghttp.Request) {
	r.Response.Write("hello world")
})
s.SetPort(8999)
s.Run()
Output:

func SetDebug

func SetDebug(enabled bool)

SetEnabled enables/disables the GoFrame internal logging manually. Note that this function is not concurrent safe, be aware of the DATA RACE, which means you should call this function in your boot but not the runtime.

func SetServerGraceful

func SetServerGraceful(enabled bool)

SetServerGraceful enables/disables graceful reload feature of http Web Server. This feature is disabled in default. Deprecated, use configuration of ghttp.Server for controlling this feature.

Types

This section is empty.

Jump to

Keyboard shortcuts

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