Versions in this module Expand all Collapse all v0 v0.0.1 Jul 4, 2024 Changes in this version + func AutoGinApiRun(ctx context.Context, cfg *Config) error + func AutoGinApiServer(cfg *Config) (*http.Server, error) + func GetHost(req *http.Request) string + func GetPostValue(req *http.Request, defaultEmpty bool, keys []string) (map[string]interface{}, error) + func ParserDataRequest(req *http.Request, data interface{}) error + type Config struct + ApiPort int + Debug bool + GinMode string + IsMockAuth bool + Logger Log + Service string + TrustedProxies []string + func GetConfigFromEnv() (*Config, error) + func (cfg *Config) AddProms(c ...prometheus.Collector) + func (cfg *Config) SetAPIs(apis ...GinAPI) + func (cfg *Config) SetAuth(authmid auth.GinAuthMidInter) + func (cfg *Config) SetMiddles(mids ...mid.GinMiddle) + func (cfg *Config) SetPreAuthMiddles(mids ...mid.GinMiddle) + func (cfg *Config) SetServerErrorHandler(handler errors.GinServerErrorHandler) + type GinAPI interface + GetAPIs func() []*GinApiHandler + type GinApiHandler struct + Auth bool + Group []auth.ApiPerm + Handler func(c *gin.Context) + Method string + Path string + type GinApiServer interface + AddAPIs func(handlers ...GinAPI) GinApiServer + GetServer func(port int) *http.Server + Middles func(mids ...mid.GinMiddle) GinApiServer + Run func(port int) error + SetAuth func(authmid auth.GinAuthMidInter) GinApiServer + SetPromhttp func(c ...prometheus.Collector) GinApiServer + SetServerErrorHandler func(errors.GinServerErrorHandler) GinApiServer + SetTrustedProxies func([]string) GinApiServer + Static func(relativePath, root string) GinApiServer + func NewGinApiServer(mode string, service string) GinApiServer + type Log interface + Fatalf func(format string, a ...any) + Infof func(format string, a ...any)