Documentation ¶
Overview ¶
Copyright 2019 txn2 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package micro is a gin-gonic wrapper.
Index ¶
Constants ¶
View Source
const ( HealthzDefaultUser = "healthz" HealthzDefaultPassword = "healthz" )
Variables ¶
This section is empty.
Functions ¶
func HealthzHandler ¶
func NoRouteHandler ¶
Types ¶
type ClientCfg ¶
type ClientCfg struct { MaxIdleConnsPerHost int // 10 connections DialContextTimeout int // 10 seconds NetTimeout int // 10 seconds ConTimeout int // 60 seconds }
ClientCfg
type MappedMetricFamily ¶
type MappedMetricFamily map[string]*ioprometheusclient.MetricFamily
type Server ¶
type Server struct { Cfg *ServerCfg Logger *zap.Logger Router *gin.Engine Client *Client Token *token.Jwt }
func NewServer ¶
NewServer
serverCfg, _ := micro.NewServerCfg("Example") server := micro.NewServer(serverCfg) server.Router.GET("/test", func(c *gin.Context) { }) server.Run()
func (*Server) ReverseProxy ¶ added in v0.0.6
func (srv *Server) ReverseProxy(cfg PxyCfg) gin.HandlerFunc
type ServerCfg ¶
type ServerCfg struct { Name string Ip string Port string Metrics bool MetricsIp string MetricsPort string Healthz bool HealthzUser string HealthzPass string LogOut string Debug bool ReadTimeout int WriteTimeout int ClientCfg *ClientCfg TokenCfg *token.JwtCfg }
func NewServerCfg ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.