Documentation
¶
Index ¶
- Constants
- Variables
- func Cors() gin.HandlerFunc
- func DefaultDecompressHandle(c *gin.Context)
- func Gzip(level int, options ...Option) gin.HandlerFunc
- type Cli
- func (c *Cli) Explain(info string) *Cli
- func (c *Cli) Item(name string) *Cli
- func (c *Cli) Save() CliInput
- func (c *Cli) SaveExplain() bool
- func (c *Cli) SetBoolDefault(d interface{}) *Cli
- func (c *Cli) SetDefault(d interface{}) *Cli
- func (c *Cli) SetExplainItem(info string) *Cli
- func (c *Cli) SetIntDefault(d interface{}) *Cli
- func (c *Cli) SetUsage(usage string) *Cli
- type CliData
- type CliInput
- type CliRow
- type ExcludedExtensions
- type ExcludedPaths
- type Explain
- type GRPCContainer
- type Ginger
- func (g *Ginger) Debug(isDebug bool) *Ginger
- func (g *Ginger) GetHTTPServeMux() *http.ServeMux
- func (g *Ginger) LoadRouter(router func(router *gin.Engine) gin.IRoutes) *Ginger
- func (g *Ginger) Run(addr string, f ...func(server *grpc.Server)) (err error)
- func (g *Ginger) Start(addr string)
- func (g *Ginger) Swagger(openSwagger bool) *Ginger
- type Option
- type Options
Constants ¶
View Source
const ( CliString = iota CliBool CliInt )
View Source
const ( ExplainMain = iota ExplainItem )
View Source
const ( BestCompression = gzip.BestCompression BestSpeed = gzip.BestSpeed DefaultCompression = gzip.DefaultCompression NoCompression = gzip.NoCompression )
Variables ¶
View Source
var ( DefaultExcludedExtensions = NewExcludedExtensions([]string{ ".png", ".gif", ".jpeg", ".jpg", }) DefaultOptions = &Options{ ExcludedExtensions: DefaultExcludedExtensions, } )
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func DefaultDecompressHandle ¶
Types ¶
type Cli ¶ added in v0.0.4
var CliIns *Cli
func (*Cli) SetBoolDefault ¶ added in v0.0.4
func (*Cli) SetDefault ¶ added in v0.0.4
func (*Cli) SetExplainItem ¶ added in v0.0.4
func (*Cli) SetIntDefault ¶ added in v0.0.4
type ExcludedExtensions ¶
Using map for better lookup performance
func NewExcludedExtensions ¶
func NewExcludedExtensions(extensions []string) ExcludedExtensions
func (ExcludedExtensions) Contains ¶
func (e ExcludedExtensions) Contains(target string) bool
type ExcludedPaths ¶
type ExcludedPaths []string
func NewExcludedPaths ¶
func NewExcludedPaths(paths []string) ExcludedPaths
func (ExcludedPaths) Contains ¶
func (e ExcludedPaths) Contains(requestURI string) bool
type GRPCContainer ¶ added in v0.0.6
type GRPCContainer struct {
// contains filtered or unexported fields
}
func (*GRPCContainer) New ¶ added in v0.0.6
func (g *GRPCContainer) New(addr string) *GRPCContainer
func (*GRPCContainer) Register ¶ added in v0.0.6
func (g *GRPCContainer) Register(server *interface{})
type Ginger ¶
var IGinger *Ginger
func (*Ginger) GetHTTPServeMux ¶ added in v0.0.6
func (*Ginger) LoadRouter ¶
加载路由
type Option ¶
type Option func(*Options)
func WithDecompressFn ¶
func WithExcludedExtensions ¶
func WithExcludedPaths ¶
type Options ¶
type Options struct { ExcludedExtensions ExcludedExtensions ExcludedPaths ExcludedPaths DecompressFn func(c *gin.Context) }
Click to show internal directories.
Click to hide internal directories.