g

package
v2.0.0-...-cbac34e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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 Config

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

Config returns an instance of config object with specified name.

func DB

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

DB is alias of Database. See Database.

func Database

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

Database returns an instance of database ORM object with specified configuration group name.

func Dump

func Dump(i ...interface{})

Dump dumps a variable to stdout with more manually readable.

func Export

func Export(i ...interface{}) string

Export exports a variable to string with more manually readable.

func GetLogLevel

func GetLogLevel() int

GetLogLevel returns the global logging level.

func I18n

func I18n(name ...string) *gi18n.Manager

I18n returns an instance of gi18n.Manager. The parameter <name> is the name for the instance.

func IsEmpty

func IsEmpty(value interface{}) bool

IsEmpty checks given value empty or not. It returns false if value is: integer(0), bool(false), slice/map(len=0), nil; or else true.

func Redis

func Redis(name ...string) *gredis.Redis

Redis returns an instance of redis client with specified configuration group name.

func Res

func Res(name ...string) *gres.Resource

Res is alias of Resource. See Resource.

func Resource

func Resource(name ...string) *gres.Resource

Resource returns an instance of Resource. The parameter <name> is the name for the instance.

func Server

func Server(name ...interface{}) *ghttp.Server

Server returns an instance of http server with specified name.

func SetDebug

func SetDebug(debug bool)

SetDebug disables/enables debug level for logging component globally.

func SetLogLevel

func SetLogLevel(level int)

SetLogLevel sets the logging level globally.

func SetServerGraceful

func SetServerGraceful(enabled bool)

SetServerGraceful enables/disables graceful reload feature of http Web Server. This feature is disabled in default.

func TCPServer

func TCPServer(name ...interface{}) *gtcp.Server

TCPServer returns an instance of tcp server with specified name.

func Throw

func Throw(exception interface{})

Throw throws a exception, which can be caught by TryCatch function. It always be used in TryCatch function.

func TryCatch

func TryCatch(try func(), catch ...func(exception interface{}))

TryCatch does the try...catch... mechanism.

func UDPServer

func UDPServer(name ...interface{}) *gudp.Server

UDPServer returns an instance of udp server with specified name.

func View

func View(name ...string) *gview.View

View returns an instance of template engine object with specified name.

func Wait

func Wait()

Wait blocks until all the web servers shutdown.

Types

type Array

type Array = []interface{}

Array is alias of Slice.

type ArrayAny

type ArrayAny = []interface{}

type ArrayInt

type ArrayInt = []int

type ArrayStr

type ArrayStr = []string

type List

type List = []Map

Frequently-used slice type alias.

type ListAnyBool

type ListAnyBool = []map[interface{}]bool

type ListAnyInt

type ListAnyInt = []map[interface{}]int

type ListAnyStr

type ListAnyStr = []map[interface{}]string

type ListIntAny

type ListIntAny = []map[int]interface{}

type ListIntBool

type ListIntBool = []map[int]bool

type ListIntInt

type ListIntInt = []map[int]int

type ListIntStr

type ListIntStr = []map[int]string

type ListStrAny

type ListStrAny = []map[string]interface{}

type ListStrBool

type ListStrBool = []map[string]bool

type ListStrInt

type ListStrInt = []map[string]int

type ListStrStr

type ListStrStr = []map[string]string

type Map

type Map = map[string]interface{}

Frequently-used map type alias.

type MapAnyAny

type MapAnyAny = map[interface{}]interface{}

type MapAnyBool

type MapAnyBool = map[interface{}]bool

type MapAnyInt

type MapAnyInt = map[interface{}]int

type MapAnyStr

type MapAnyStr = map[interface{}]string

type MapIntAny

type MapIntAny = map[int]interface{}

type MapIntBool

type MapIntBool = map[int]bool

type MapIntInt

type MapIntInt = map[int]int

type MapIntStr

type MapIntStr = map[int]string

type MapStrAny

type MapStrAny = map[string]interface{}

type MapStrBool

type MapStrBool = map[string]bool

type MapStrInt

type MapStrInt = map[string]int

type MapStrStr

type MapStrStr = map[string]string

type Slice

type Slice = []interface{}

Frequently-used slice type alias.

type SliceAny

type SliceAny = []interface{}

type SliceInt

type SliceInt = []int

type SliceStr

type SliceStr = []string

type Var

type Var = gvar.Var

Universal variable type, like generics.

func NewVar

func NewVar(i interface{}, safe ...bool) *Var

NewVar returns a *gvar.Var.

Jump to

Keyboard shortcuts

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