Versions in this module Expand all Collapse all v1 v1.1.6 Nov 11, 2022 Changes in this version type Option + func WithRecoveryFunc(f gin.RecoveryFunc) Option v0 v0.1.0 Nov 11, 2022 v0.0.3 Nov 11, 2022 v0.0.1 Nov 11, 2022 Changes in this version + const HeaderAcceptEncoding + const HeaderContentType + const HeaderGRPCPROXYError + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationProtobuf + const PackageName + func GRPCProxy(h interface{}) gin.HandlerFunc + type Component struct + Server *http.Server + func (c *Component) BuildWebsocket(opts ...WebSocketOption) *WebSocket + func (c *Component) GetEmbedWrapper() *EmbedWrapper + func (c *Component) GracefulStop(ctx context.Context) error + func (c *Component) HTTPEmbedFs() http.FileSystem + func (c *Component) Info() *server.ServiceInfo + func (c *Component) Init() error + func (c *Component) Listener() net.Listener + func (c *Component) Name() string + func (c *Component) PackageName() string + func (c *Component) RegisterRouteComment(method, path, comment string) + func (c *Component) Start() error + func (c *Component) Stop() error + func (c *Component) Upgrade(pattern string, ws *WebSocket, handler WebSocketFunc) gin.IRoutes + type Config struct + AccessInterceptorReqResFilter string + ContextTimeout time.Duration + EmbedPath string + EnableAccessInterceptor bool + EnableAccessInterceptorReq bool + EnableAccessInterceptorRes bool + EnableLocalMainIP bool + EnableMetricInterceptor bool + EnableSentinel bool + EnableTLS bool + EnableTraceInterceptor bool + EnableTrustedCustomHeader bool + EnableWebsocketCheckOrigin bool + EnableWebsocketCompression bool + Host string + Mode string + Network string + Port int + ServerReadHeaderTimeout time.Duration + ServerReadTimeout time.Duration + ServerWriteTimeout time.Duration + SlowLogThreshold time.Duration + TLSCertFile string + TLSClientAuth string + TLSClientCAs []string + TLSKeyFile string + TLSSessionCache tls.ClientSessionCache + TrustedPlatform string + WebsocketHandshakeTimeout time.Duration + WebsocketReadBufferSize int + WebsocketWriteBufferSize int + func DefaultConfig() *Config + func (config *Config) Address() string + func (config *Config) ClientAuthType() tls.ClientAuthType + type Container struct + func DefaultContainer() *Container + func Load(key string) *Container + func (c *Container) Build(options ...Option) *Component + type EmbedWrapper struct + func (e *EmbedWrapper) Open(name string) (fs.File, error) + type Option func(c *Container) + func WithContextTimeout(timeout time.Duration) Option + func WithEmbedFs(fs embed.FS) Option + func WithHost(host string) Option + func WithLogger(logger *elog.Component) Option + func WithNetwork(network string) Option + func WithPort(port int) Option + func WithSentinelBlockFallback(fn func(*gin.Context)) Option + func WithSentinelResourceExtractor(fn func(*gin.Context) string) Option + func WithServerReadHeaderTimeout(timeout time.Duration) Option + func WithServerReadTimeout(timeout time.Duration) Option + func WithServerWriteTimeout(timeout time.Duration) Option + func WithTLSSessionCache(tsc tls.ClientSessionCache) Option + func WithTrustedPlatform(trustedPlatform string) Option + type WebSocket struct + func (ws *WebSocket) Upgrade(w http.ResponseWriter, r *http.Request, c *gin.Context, handler WebSocketFunc) + type WebSocketConn struct + GinCtx *gin.Context + type WebSocketFunc func(*WebSocketConn, error) + type WebSocketOption func(*WebSocket)