Documentation ¶
Index ¶
- 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
- 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)
- func (cfg *Config) SetSessionStore(store session.ManagerStore)
- type GinAPI
- type GinApiHandler
- type GinApiServer
- type Log
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPostValue ¶
func ParserDataRequest ¶
Types ¶
type Config ¶ added in v1.1.0
type Config struct { Service string GinMode string IsMockAuth bool ApiPort int TrustedProxies []string Debug bool // autopaho and paho debug output requested SessionHeaderName string SessionExpired time.Duration Logger Log // contains filtered or unexported fields }
config holds the configuration
func GetConfigFromEnv ¶ added in v1.1.0
getConfig - Retrieves the configuration from the environment
func (*Config) AddProms ¶ added in v1.1.0
func (cfg *Config) AddProms(c ...prometheus.Collector)
func (*Config) SetAuth ¶ added in v1.1.0
func (cfg *Config) SetAuth(authmid auth.GinAuthMidInter)
func (*Config) SetMiddles ¶ added in v1.1.0
func (*Config) SetPreAuthMiddles ¶ added in v1.2.0
func (*Config) SetServerErrorHandler ¶ added in v1.1.0
func (cfg *Config) SetServerErrorHandler(handler errors.GinServerErrorHandler)
func (*Config) SetSessionStore ¶ added in v1.6.0
func (cfg *Config) SetSessionStore(store session.ManagerStore)
type GinAPI ¶
type GinAPI interface { errors.ApiErrorHandler GetAPIs() []*GinApiHandler }
type GinApiHandler ¶
type GinApiServer ¶
type GinApiServer interface { AddAPIs(handlers ...GinAPI) GinApiServer Middles(mids ...mid.GinMiddle) GinApiServer SetServerErrorHandler(errors.GinServerErrorHandler) GinApiServer SetAuth(authmid auth.GinAuthMidInter) GinApiServer SetTrustedProxies([]string) GinApiServer SetPromhttp(c ...prometheus.Collector) GinApiServer SetSession(sessionHeaderName string, store session.ManagerStore, expired time.Duration) GinApiServer Static(relativePath, root string) GinApiServer Run(port int) error GetServer(port int) *http.Server // contains filtered or unexported methods }
func NewGinApiServer ¶
func NewGinApiServer(mode string, service string) GinApiServer
Click to show internal directories.
Click to hide internal directories.