Documentation ¶
Index ¶
- Variables
- func CorsHandler() gin.HandlerFunc
- func DefaultHeader() gin.HandlerFunc
- func Error(c *gin.Context, code string, message string, t ...string) gin.H
- func ErrorResponse(code string, message string) gin.H
- func GetSessionStore(option SessionOption) sessions.Store
- func GinReUnmarshal(i interface{}) (gin.H, error)
- func GinUnmarshal(r io.Reader) (gin.H, error)
- func LoadDefaultLifecycle()
- func LoadServer()
- func LoadSession(resourceName string) gin.HandlerFunc
- func NewSvcLifecycle() *svcLifecycle
- func NotFoundResponse(c *gin.Context)
- func PairValues(i, o interface{}) error
- func ParseRequest(c *gin.Context, request interface{}) error
- func ResponseJSON(c *gin.Context, code int, obj interface{})
- func Session(c *gin.Context) sessions.Session
- func Start()
- func Stop()
- type Config
- type CorsConf
- type CorsOptions
- type JwtConf
- type JwtOption
- type Listen
- type ListenConf
- type ListenSsl
- type ListenSslConf
- type Map
- type ModeConfg
- type SessionConf
- type SessionOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Route variable Route *gin.Engine // ListenConfig variable ListenConfig ListenConf // ListenSslConfig variable ListenSslConfig ListenSslConf // Mode variable Mode ModeConfg )
View Source
var DefaultResourceName = ""
DefaultResourceName variable
View Source
var PrivateKey = make(map[string]interface{})
PrivateKey variable
View Source
var PublicKey = make(map[string]interface{})
PublicKey variable
Functions ¶
func GetSessionStore ¶
func GetSessionStore(option SessionOption) sessions.Store
GetSessionStore function
func LoadDefaultLifecycle ¶
func LoadDefaultLifecycle()
LoadDefaultLifecycle is enable lifecycle liveness and readiness probe
func NewSvcLifecycle ¶
func NewSvcLifecycle() *svcLifecycle
func ParseRequest ¶
ParseRequest function
func ResponseJSON ¶
ResponseJSON function
Types ¶
type CorsConf ¶
type CorsConf struct {
CorsOptions CorsOptions `json:"cors" bson:"cors"`
}
CorsConf struct
var Cors CorsConf
Cors variable
type CorsOptions ¶
type CorsOptions struct { UseSetting bool `json:"useSetting" bson:"useSetting"` AllowAllOrigins bool `json:"allowAllOrigins" bson:"allowAllOrigins"` AllowOrigins []string `json:"allowOrigins" bson:"allowOrigins"` AllowMethods []string `json:"allowMethods" bson:"allowMethods"` AllowHeaders []string `json:"allowHeaders" bson:"allowHeaders"` AllowCredentials bool `json:"allowCredentials" bson:"allowCredentials"` ExposeHeaders []string `json:"exposeHeaders" bson:"exposeHeaders"` AllowWildcard bool `json:"allowWildcard" bson:"allowWildcard"` MaxAgeSec int `json:"maxAgeSec" bson:"maxAgeSec"` }
CorsOptions is option of cors that defined from config
type JwtConf ¶
type JwtConf struct {
JwtOptions []JwtOption `json:"jwtResources" bson:"jwtResources"`
}
JwtConf struct
var ( // Secret variable Secret JwtConf )
type JwtOption ¶
type JwtOption struct { Name string `json:"name" bson:"name"` Secret string `json:"secret" bson:"secret"` Algorithm string `json:"algorithm" bson:"algorithm"` ExpirationSec int `json:"expiration" bson:"expiration"` PrivateKey string `json:"privateKey" bson:"privateKey"` PublicKey string `json:"publicKey" bson:"publicKey"` }
JwtOption struct
type Listen ¶
type Listen struct { ListenAddr string `json:"listenAddr" bson:"listenAddr"` ListenPort string `json:"listenPort" bson:"listenPort"` Ssl bool `json:"ssl" bson:"ssl"` }
Listen struct
type ListenConf ¶
type ListenConf struct {
Listen Listen `json:"listen" bson:"listen"`
}
ListenConf struct
type ListenSsl ¶
type ListenSsl struct { AutoTls bool `json:"autotls" bson:"autotls"` Domain []string `json:"domain" bson:"domain"` ListenAddr string `json:"listenAddr" bson:"listenAddr"` ListenPort string `json:"listenPort" bson:"listenPort"` CertFile string `json:"certFile" bson:"certFile"` KeyFile string `json:"keyFile" bson:"keyFile"` SslOnly bool `json:"sslOnly" bson:"sslOnly"` }
ListenSsl struct
type ListenSslConf ¶
type ListenSslConf struct {
ListenSsl ListenSsl `json:"ssl" bson:"ssl"`
}
ListenSslConf struct
type SessionConf ¶
type SessionConf struct {
SessionOption []SessionOption `json:"sessionResources" bson:"sessionResources"`
}
SessionConf struct
var ( // Sess variable Sess SessionConf )
type SessionOption ¶
type SessionOption struct { Name string `json:"name" bson:"name"` Type string `json:"type" bson:"type"` Host string `json:"host" bson:"host"` Secret string `json:"secret" bson:"secret"` Password string `json:"password" bson:"password"` ExpirationSec int `json:"expiration" bson:"expiration"` SessionName string `json:"sessionName" bson:"sessionName"` }
SessionOption struct
func GetSessionResource ¶
func GetSessionResource(resourceName string) SessionOption
GetSessionResource function
Click to show internal directories.
Click to hide internal directories.