Documentation ¶
Overview ¶
Third Party Packags: - github.com/gin-gonic/gin - github.com/spf13/viper
- go.uber.org/multierr - go.uber.org/zap - go.uber.org/zap/zapcore - gopkg.in/natefinch/lumberjack.v2
- github.com/prometheus/client_golang/prometheus - github.com/prometheus/client_golang/prometheus/promauto - github.com/prometheus/client_golang/prometheus/promhttp
Index ¶
- func CacheControl(seconds int) gin.HandlerFunc
- func Cors(origin string) gin.HandlerFunc
- func GetAddr(ctx *gin.Context) (ap netip.AddrPort, err error)
- func GetAddrString(ctx *gin.Context) string
- func GetCtxValue[T any](ctx *gin.Context, key string) (v T, ok bool)
- func GinJwtHSAuth(auth *JwtHSAuth, handle func(*gin.Context, map[string]any) error) gin.HandlerFunc
- func Healthy(ctx *gin.Context)
- func LoadConfigFile(name, fp string) (conf *viper.Viper, err error)
- func LoadConfigString(name, str, typ string) (conf *viper.Viper, err error)
- func NewPrometheusMonitor(namespace string) gin.HandlerFunc
- func Pprof(rg *gin.RouterGroup, handlers ...gin.HandlerFunc)
- func PrometheusFunc(ctx *gin.Context)
- func ReadConfigField(name, fp, sp string) (out string, err error)
- func ServeFavicon(bts []byte, ts ...time.Time) gin.HandlerFunc
- func UnmarshalConfigFile(name, fp string, objects map[string]any) (err error)
- func WriteJSON(ctx *gin.Context, bts []byte) (int, error)
- func WsUpgrade(ctx *gin.Context)
- type JwtHSAuth
- type JwtRSAAuth
- type Logger
- type StaticDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheControl ¶
func CacheControl(seconds int) gin.HandlerFunc
func Cors ¶
func Cors(origin string) gin.HandlerFunc
func GetAddrString ¶
func GinJwtHSAuth ¶
func Pprof ¶
func Pprof(rg *gin.RouterGroup, handlers ...gin.HandlerFunc)
func PrometheusFunc ¶
func ReadConfigField ¶
func ServeFavicon ¶
func ServeFavicon(bts []byte, ts ...time.Time) gin.HandlerFunc
func UnmarshalConfigFile ¶
Types ¶
type JwtRSAAuth ¶
type JwtRSAAuth struct {
// contains filtered or unexported fields
}
func NewRSAAuth ¶
func NewRSAAuth(privateKeyFile, publicKeyFile string, code uint) (auth *JwtRSAAuth, err error)
type Logger ¶
type Logger struct { Writer *lumberjack.Logger *zap.Logger // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.