Documentation ¶
Index ¶
- type ContentTypeResourceLoader
- type DefaultContentTypeManager
- type DefaultContext
- func (inst *DefaultContext) GetConnectorByName(name string) (libgin.Connector, error)
- func (inst *DefaultContext) GetGroupByName(name string) (libgin.Group, error)
- func (inst *DefaultContext) GetRouterByName(name string) (libgin.Router, error)
- func (inst *DefaultContext) Life() *application.Life
- func (inst *DefaultContext) ListControllersForGroup(wantGroupName string) ([]*libgin.ControllerRegistration, error)
- type DefaultRouter
- type GroupBuilder
- type HTTP404Controller
- type HTTPConnector
- type HTTPSConnector
- type JSONGinResponder
- type MainResponder
- type RESTGroupRegistry
- type StaticController
- type StaticGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentTypeResourceLoader ¶
type ContentTypeResourceLoader struct { Context application.Context //starter:inject("context") TypesProps string //starter:inject("${web.content-types.properties}") // contains filtered or unexported fields }
ContentTypeResourceLoader 负责从指定的资源文件中加载类型信息
func (*ContentTypeResourceLoader) ListRegistrations ¶
func (inst *ContentTypeResourceLoader) ListRegistrations() []*mimetypes.Registration
ListRegistrations ...
type DefaultContentTypeManager ¶
type DefaultContentTypeManager struct { Source mimetypes.Manager //starter:inject("#") // contains filtered or unexported fields }
DefaultContentTypeManager ...
func (*DefaultContentTypeManager) FindTypeBySuffix ¶
func (inst *DefaultContentTypeManager) FindTypeBySuffix(suffix string) (string, error)
FindTypeBySuffix ...
func (*DefaultContentTypeManager) Life ¶
func (inst *DefaultContentTypeManager) Life() *application.Life
Life ...
type DefaultContext ¶
type DefaultContext struct { Controllers []libgin.Controller //starter:inject(".") Connectors []libgin.ConnectorRegistry //starter:inject(".") Routers []libgin.RouterRegistry //starter:inject(".") Groups []libgin.GroupRegistry //starter:inject(".") DefaultGroupName string //starter:inject("${web.default-group-name}") // contains filtered or unexported fields }
DefaultContext ...
func (*DefaultContext) GetConnectorByName ¶
func (inst *DefaultContext) GetConnectorByName(name string) (libgin.Connector, error)
GetConnectorByName ...
func (*DefaultContext) GetGroupByName ¶
func (inst *DefaultContext) GetGroupByName(name string) (libgin.Group, error)
GetGroupByName ...
func (*DefaultContext) GetRouterByName ¶
func (inst *DefaultContext) GetRouterByName(name string) (libgin.Router, error)
GetRouterByName ...
func (*DefaultContext) ListControllersForGroup ¶
func (inst *DefaultContext) ListControllersForGroup(wantGroupName string) ([]*libgin.ControllerRegistration, error)
ListControllersForGroup ...
type DefaultRouter ¶
type DefaultRouter struct { AppContext application.Context //starter:inject("context") Context libgin.Context //starter:inject("#") Name string //starter:inject("${web-router.default.name}") GroupList string //starter:inject("${web-router.default.groups}") GinMode string //starter:inject("${gin.mode}") // contains filtered or unexported fields }
DefaultRouter 默认路由
func (*DefaultRouter) ListRegistrations ¶ added in v1.0.8
func (inst *DefaultRouter) ListRegistrations() []*libgin.RouterRegistration
ListRegistrations ...
type GroupBuilder ¶
GroupBuilder 用于创建 libgin.Group 实例
func (*GroupBuilder) Create ¶
func (inst *GroupBuilder) Create() libgin.Group
Create 创建 libgin.Group 实例
type HTTP404Controller ¶ added in v1.0.16
type HTTP404Controller struct { AppContext application.Context //starter:inject("context") ResponseContentRes string //starter:inject("${libgin.http404.page.resource}") ResponseContentType string //starter:inject("${libgin.http404.page.mediatype}") ResponseCode int //starter:inject("${libgin.http404.page.status}") HandlerPriority int //starter:inject("${libgin.http404.page.priority}") // contains filtered or unexported fields }
HTTP404Controller ...
func (*HTTP404Controller) Registration ¶ added in v1.0.16
func (inst *HTTP404Controller) Registration() *libgin.ControllerRegistration
Registration 。。。
type HTTPConnector ¶
type HTTPConnector struct { AppContext application.Context //starter:inject("context") Context libgin.Context //starter:inject("#") Stopper stopper.Service //starter:inject("#") Host string //starter:inject("${server.http.host}") Port int //starter:inject("${server.http.port}") Enabled bool //starter:inject("${server.http.enabled}") // contains filtered or unexported fields }
HTTPConnector 是默认的 HTTP 连接器
func (*HTTPConnector) ListRegistrations ¶ added in v1.0.8
func (inst *HTTPConnector) ListRegistrations() []*libgin.ConnectorRegistration
ListRegistrations ...
type HTTPSConnector ¶
type HTTPSConnector struct { AppContext application.Context //starter:inject("context") Context libgin.Context //starter:inject("#") Stopper stopper.Service //starter:inject("#") Enabled bool //starter:inject("${server.https.enabled}") Host string //starter:inject("${server.https.host}") Port int //starter:inject("${server.https.port}") KeyFile string //starter:inject("${server.https.key-file}") CertFile string //starter:inject("${server.https.certificate-file}") // contains filtered or unexported fields }
HTTPSConnector 是默认的 HTTPS 连接器
func (*HTTPSConnector) ListRegistrations ¶ added in v1.0.8
func (inst *HTTPSConnector) ListRegistrations() []*libgin.ConnectorRegistration
ListRegistrations ...
func (*HTTPSConnector) SetHandler ¶
func (inst *HTTPSConnector) SetHandler(h http.Handler)
SetHandler ...
type JSONGinResponder ¶ added in v1.0.11
type JSONGinResponder struct {
// contains filtered or unexported fields
}
JSONGinResponder ...
func (*JSONGinResponder) Accept ¶ added in v1.0.11
func (inst *JSONGinResponder) Accept(resp *libgin.Response) bool
Accept ...
func (*JSONGinResponder) ListRegistrations ¶ added in v1.0.11
func (inst *JSONGinResponder) ListRegistrations() []*libgin.ResponderRegistration
ListRegistrations ...
func (*JSONGinResponder) Send ¶ added in v1.0.11
func (inst *JSONGinResponder) Send(resp *libgin.Response)
Send ...
type MainResponder ¶ added in v1.0.2
type MainResponder struct { ResponderRegs []libgin.ResponderRegistry //starter:inject(".") // contains filtered or unexported fields }
MainResponder 是统一的 Responder 主入口
func (*MainResponder) Accept ¶ added in v1.0.2
func (inst *MainResponder) Accept(r *libgin.Response) bool
Accept ...
func (*MainResponder) ListRegistrations ¶ added in v1.0.8
func (inst *MainResponder) ListRegistrations() []*libgin.ResponderRegistration
ListRegistrations ...
func (*MainResponder) Send ¶ added in v1.0.2
func (inst *MainResponder) Send(res *libgin.Response)
Send ...
type RESTGroupRegistry ¶ added in v1.0.8
type RESTGroupRegistry struct { AC application.Context //starter:inject("context") Context libgin.Context //starter:inject("#") GroupIDList string //starter:inject("${web.groups}") // contains filtered or unexported fields }
RESTGroupRegistry 是默认的 RESTful-API 控制器组
func (*RESTGroupRegistry) ListRegistrations ¶ added in v1.0.8
func (inst *RESTGroupRegistry) ListRegistrations() []*libgin.GroupRegistration
ListRegistrations ...
type StaticController ¶
type StaticController struct { Context application.Context //starter:inject("context") ResPath string //starter:inject("${web-group.static.resources}") IndexNames string //starter:inject("${web-group.static.index-names}") Types libgin.ContentTypeManager //starter:inject("#") // contains filtered or unexported fields }
StaticController 是静态资源控制器,它负责把静态的web资源注册到 static-group
func (*StaticController) Registration ¶
func (inst *StaticController) Registration() *libgin.ControllerRegistration
Registration ...
type StaticGroup ¶
type StaticGroup struct { Context libgin.Context //starter:inject("#") Path string //starter:inject("${web-group.static.path}") Name string //starter:inject("${web-group.static.name}") // contains filtered or unexported fields }
StaticGroup 是默认的静态资源控制器组
func (*StaticGroup) Registration ¶
func (inst *StaticGroup) Registration() *libgin.GroupRegistration
Registration ...