Documentation ¶
Index ¶
- Constants
- func DefaultGinEngine() *gin.Engine
- func GinDotConfigTypeLive() *dot.ConfigTypeLive
- func GinDotTypeLives() []*dot.TypeLives
- func PreAddControlDot(ctype reflect.Type, routerID dot.LiveID) *dot.TypeLives
- func RouterConfigTypeLive() *dot.ConfigTypeLive
- func RouterGet(g *gin.RouterGroup, h interface{}, pre string)
- func RouterPost(g *gin.RouterGroup, h interface{}, pre string)
- func RouterSelf(h interface{}, pre string, call func(url string, gmethod reflect.Value))
- func RouterTypeLives() []*dot.TypeLives
- func UiConfigTypeLive() *dot.ConfigTypeLive
- func UiTypeLives() []*dot.TypeLives
- type Encoding
- type Engine
- type FileServer
- type Router
- func (c *Router) AfterAllInject(l dot.Line)
- func (c *Router) RelativePath() string
- func (c *Router) Router() *gin.RouterGroup
- func (c *Router) RouterGet(h interface{}, pre string)
- func (c *Router) RouterPost(h interface{}, pre string)
- func (c *Router) SetTypeID(_ dot.TypeID, liveID dot.LiveID)
- func (c *Router) Start(ignore bool) error
- type Ui
Constants ¶
const ( //EngineTypeID for gin dot EngineTypeID = "4943e959-7ad7-42c6-84dd-8b24e9ed30bb" //EngineLiveID for gin dot EngineLiveID = "4943e959-7ad7-42c6-84dd-8b24e9ed30bb" )
const (
//RouterTypeID for gin dot
RouterTypeID = "6be39d0b-3f5b-47b4-818c-642c049f3166"
)
const UiTypeID = "d9972be7-cef9-464c-9bbb-d1f11abea803" //type id of dot
Variables ¶
This section is empty.
Functions ¶
func DefaultGinEngine ¶
DefaultGinEngine return the default gin dot, it have to call after the line ceated
func GinDotConfigTypeLive ¶
func GinDotConfigTypeLive() *dot.ConfigTypeLive
jayce edit return config of GinDot
func GinDotTypeLives ¶
GinDotTypeLives generate data for structural dot
func PreAddControlDot ¶
GinDotTypeLives generate data for structural dot routerID: is the liveid of gindot/router component
func RouterConfigTypeLive ¶
func RouterConfigTypeLive() *dot.ConfigTypeLive
jayce edit return config of Router
func RouterSelf ¶
for each funcs that like “gin.HandlerFunc” sampe pre = "scry", and "func (c * SampleCtroller) Hello(cxt *gin.Context) {}", the url is "/scry/hello"
func RouterTypeLives ¶
RouterTypeLives generate data for structural dot, include gindot.Engine
func UiTypeLives ¶
UiTypeLives generate data for structural dot, include gindot.Engine
Types ¶
type Encoding ¶
type Encoding struct { Name string `json:"name"` // the Encoding Name Extension string `json:"extension"` // the file Extension (including a leading dot) ClientPreference float64 `json:"clientPreference"` // the client's preference ServerPreference int `json:"serverPreference"` // the server's preference }
Encoding represents an Accept-Encoding. All of these fields are pre-populated in the supportedEncodings variable, except the ClientPreference which is updated (by copying a value from supportedEncodings) when examining client headers.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
GinEngine gin dot
func (*Engine) AfterAllStart ¶
AfterAllStart run the function after start
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
see https://github.com/lpar/gzipped/blob/master/fileserver.go FileServer is a drop-in replacement for Go's standard http.FileServer which adds support for static resources precompressed with gzip, at the cost of removing the support for directory browsing.
If file filename.ext has a compressed version filename.ext.gz alongside it, if the client indicates that it accepts gzip-compressed data, and if the .gz file can be opened, then the compressed version of the file will be sent to the client. Otherwise the request is passed on to http.ServeContent, and the raw (uncompressed) version is used.
It is up to you to ensure that the compressed and uncompressed versions of files match and have sensible timestamps.
Compressed or not, requests are fulfilled using http.ServeContent, and details like accept ranges and content-type sniffing are handled by that method.
func NewFileServer ¶
func NewFileServer(resPath string, paramName string, encodings []Encoding) *FileServer
func (*FileServer) Handler ¶
func (c *FileServer) Handler(ctx *gin.Context)
type Router ¶
type Router struct { Engine_ *Engine `dot:""` // contains filtered or unexported fields }
Router gin router
func (*Router) AfterAllInject ¶
func (*Router) RelativePath ¶
func (*Router) Router ¶
func (c *Router) Router() *gin.RouterGroup
type Ui ¶
type Ui struct { Engine_ *Engine `dot:""` // contains filtered or unexported fields }
Ui add static resource into gin
func (*Ui) ResAbsolutePath ¶
ResAbsolutePath the order of locating files is: absolute path, relative path,executable path,current path,user path if do not find, then return ""
func (*Ui) ResRelativePath ¶
func (*Ui) Router ¶
func (c *Ui) Router() *gin.RouterGroup