gindot

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//EngineTypeID for gin dot
	EngineTypeID = "4943e959-7ad7-42c6-84dd-8b24e9ed30bb"
	//EngineLiveID for gin dot
	EngineLiveID = "4943e959-7ad7-42c6-84dd-8b24e9ed30bb"
)
View Source
const (
	//RouterTypeID for gin dot
	RouterTypeID = "6be39d0b-3f5b-47b4-818c-642c049f3166"
)
View Source
const UiTypeID = "d9972be7-cef9-464c-9bbb-d1f11abea803" //type id of dot

Variables

This section is empty.

Functions

func DefaultGinEngine

func DefaultGinEngine() *gin.Engine

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

func GinDotTypeLives() []*dot.TypeLives

GinDotTypeLives generate data for structural dot

func PreAddControlDot

func PreAddControlDot(ctype reflect.Type, routerID dot.LiveID) *dot.TypeLives

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 RouterGet

func RouterGet(g *gin.RouterGroup, h interface{}, pre string)

all get

func RouterPost

func RouterPost(g *gin.RouterGroup, h interface{}, pre string)

all post

func RouterSelf

func RouterSelf(h interface{}, pre string, call func(url string, gmethod reflect.Value))

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

func RouterTypeLives() []*dot.TypeLives

RouterTypeLives generate data for structural dot, include gindot.Engine

func UiConfigTypeLive

func UiConfigTypeLive() *dot.ConfigTypeLive

return config of Ui

func UiTypeLives

func UiTypeLives() []*dot.TypeLives

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

func (c *Engine) AfterAllStart(l dot.Line)

AfterAllStart run the function after start

func (*Engine) Create

func (c *Engine) Create(l dot.Line) error

Create create the gin

func (*Engine) GinEngine

func (c *Engine) GinEngine() *gin.Engine

func (*Engine) RouterGet

func (c *Engine) RouterGet(h interface{}, pre string)

all get

func (*Engine) RouterPost

func (c *Engine) RouterPost(h interface{}, pre string)

all post

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 (c *Router) AfterAllInject(l dot.Line)

func (*Router) RelativePath

func (c *Router) RelativePath() string

func (*Router) Router

func (c *Router) Router() *gin.RouterGroup

func (*Router) RouterGet

func (c *Router) RouterGet(h interface{}, pre string)

all get

func (*Router) RouterPost

func (c *Router) RouterPost(h interface{}, pre string)

all post

func (*Router) SetTypeID

func (c *Router) SetTypeID(_ dot.TypeID, liveID dot.LiveID)

func (*Router) Start

func (c *Router) Start(ignore bool) error

Start start the gin

type Ui

type Ui struct {
	Engine_ *Engine `dot:""`
	// contains filtered or unexported fields
}

Ui add static resource into gin

func (*Ui) Injected

func (c *Ui) Injected(l dot.Line) error

func (*Ui) ResAbsolutePath

func (c *Ui) ResAbsolutePath(res string) string

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 (c *Ui) ResRelativePath() string

func (*Ui) Router

func (c *Ui) Router() *gin.RouterGroup

func (*Ui) SetResRelativePath

func (c *Ui) SetResRelativePath(relativePath string)

func (*Ui) Start

func (c *Ui) Start(ignore bool) error

Start start the gin

func (*Ui) UrlRelativePath

func (c *Ui) UrlRelativePath() string

Jump to

Keyboard shortcuts

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