Documentation
¶
Index ¶
- func InitializeWebServer(config *Config) (server.Server, error)
- func InstallGenericAPI(engine *gin.Engine)
- func NewWebServer(serverMode string, serverConfig *ServerConfig) (server.Server, error)
- func ProvideDB(cfg *Config) (*gorm.DB, error)
- type Config
- type ServerConfig
- type UnionServer
- type UserRetriever
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallGenericAPI ¶
InstallGenericAPI 注册业务无关的路由,例如 pprof、404 处理等.
func NewWebServer ¶
func NewWebServer(serverMode string, serverConfig *ServerConfig) (server.Server, error)
Types ¶
type Config ¶
type Config struct {
ServerMode string
JWTKey string
Expiration time.Duration
EnableMemoryStore bool
HTTPOptions *genericoptions.HTTPOptions
TLSOptions *genericoptions.TLSOptions
MySQLOptions *genericoptions.MySQLOptions
}
func (*Config) NewUnionServer ¶
func (cfg *Config) NewUnionServer() (*UnionServer, error)
type ServerConfig ¶
type ServerConfig struct {
// contains filtered or unexported fields
}
func (*ServerConfig) InstallRESTAPI ¶
func (c *ServerConfig) InstallRESTAPI(engine *gin.Engine)
注册 API 路由。路由的路径和 HTTP 方法,严格遵循 REST 规范.
func (*ServerConfig) NewGinServer ¶
func (c *ServerConfig) NewGinServer() server.Server
NewGinServer 初始化一个新的 Gin 服务器实例.
type UnionServer ¶
type UnionServer struct {
// contains filtered or unexported fields
}
func (*UnionServer) Run ¶
func (s *UnionServer) Run() error
Click to show internal directories.
Click to hide internal directories.