Documentation ¶
Index ¶
- Constants
- Variables
- func LoadAutoDocsHandler(app *iris.Application)
- func LoadController(topicCategory string, controller Controller) error
- func LoadControllers(topicCategory string, controllers []Controller, app ...router.Party) error
- func QueryMQ(topicCategory string, routingKey string, ctx SessionContext, ...) error
- func SetController(name string, controller Controller)
- type AbstractController
- func (c *AbstractController) GetName() string
- func (c *AbstractController) GetTopicCategory() string
- func (c *AbstractController) HasConsumedMQ() bool
- func (c *AbstractController) IsDisablesAuthorization() bool
- func (c *AbstractController) SetConsumedMQ(consumed bool)
- func (c *AbstractController) SetName(name string)
- func (c *AbstractController) SetTopicCategory(topicCategory string)
- type Controller
- type HandlerError
- type HandlerStatus
- type MQHandler
- type MQHandlers
- type SessionContext
- type StatusCodeResultType
Constants ¶
const (
APIBaseURI = "/api/"
)
Constants
Variables ¶
var ( HandlerPrefix = map[string]string{ "Handler": "POST", "Handle": "POST", "Get": "GET", "Post": "POST", "Put": "PUT", "Patch": "PATCH", "Delete": "DELETE", "Option": "OPTION", "Head": "HEAD", } SkipControllerHanderNames = map[string]bool{ "GetName": true, "SetName": true, "GetTopicCategory": true, "SetTopicCategory": true, "afterAnalyzedHandlers": true, "GetFilters": true, "GetVisitors": true, "GetObservers": true, "GetDelegates": true, } )
global variables
Functions ¶
func LoadAutoDocsHandler ¶
func LoadAutoDocsHandler(app *iris.Application)
LoadAutoDocsHandler manually load docs handler
func LoadController ¶
func LoadController(topicCategory string, controller Controller) error
LoadController load micro service controller as MQ consumer handlers and RESTful handlers
func LoadControllers ¶
func LoadControllers(topicCategory string, controllers []Controller, app ...router.Party) error
LoadControllers load micro service controllers as MQ consumer handlers and RESTful handlers
func QueryMQ ¶
func QueryMQ(topicCategory string, routingKey string, ctx SessionContext, param serializers.SerializableParam, response serializers.SerializableParam) error
QueryMQ with serializable parameter
func SetController ¶
func SetController(name string, controller Controller)
SetController by controller name and controller instance
Types ¶
type AbstractController ¶
type AbstractController struct { filters.FiltersChain visitors.VisitorsChain observers.ObserversChain delegates.DelegatesChain // contains filtered or unexported fields }
AbstractController base controller
func (*AbstractController) GetName ¶
func (c *AbstractController) GetName() string
GetName controller name
func (*AbstractController) GetTopicCategory ¶
func (c *AbstractController) GetTopicCategory() string
GetTopicCategory mq category
func (*AbstractController) HasConsumedMQ ¶
func (c *AbstractController) HasConsumedMQ() bool
HasConsumedMQ boolean
func (*AbstractController) IsDisablesAuthorization ¶
func (c *AbstractController) IsDisablesAuthorization() bool
IsDisablesAuthorization boolean
func (*AbstractController) SetConsumedMQ ¶
func (c *AbstractController) SetConsumedMQ(consumed bool)
SetConsumedMQ boolean
func (*AbstractController) SetName ¶
func (c *AbstractController) SetName(name string)
SetName mq category
func (*AbstractController) SetTopicCategory ¶
func (c *AbstractController) SetTopicCategory(topicCategory string)
SetTopicCategory mq category
type Controller ¶
type Controller interface { filters.FilterOperator visitors.VisitorOperator observers.ObserverOperator delegates.DelegateOperator GetName() string SetName(name string) GetTopicCategory() string SetTopicCategory(topicCategory string) IsDisablesAuthorization() bool HasConsumedMQ() bool SetConsumedMQ(consumed bool) // contains filtered or unexported methods }
Controller interface
func InitMQRegisterController ¶
func InitMQRegisterController(topicCategory string) Controller
InitMQRegisterController for mq register
type HandlerError ¶
HandlerError handler execute error code
func NewHandlerError ¶
func NewHandlerError(code int, message string) HandlerError
NewHandlerError HandlerError
type HandlerStatus ¶
HandlerStatus handler execute error code
type MQHandler ¶
type MQHandler interface { autodocs.DocsHandler GetGroup() string GetName() string PreExecute(mqenv.MQConsumerMessage) *mqenv.MQPublishMessage Execute(mqenv.MQConsumerMessage) *mqenv.MQPublishMessage SetMQTopic(string) GetMQTopic() string GetController() Controller IsDisablesAuthorization() bool }
MQHandler interface of mq handler
type MQHandlers ¶
type MQHandlers interface { Execute(mqenv.MQConsumerMessage) *mqenv.MQPublishMessage RegisterHandlers(topicCategory string, hs map[string]MQHandler) error GetHandler(routingKey string) resthandlers.Handler AllDocHandlers() []autodocs.DocsHandler }
MQHandlers interface of mq handler manager
type SessionContext ¶
type SessionContext struct { AppID string UserID string RequestSn string CorrelationID string ContentSerializationType string }
SessionContext carries application info and user session info
func CreateSessionContextWithConsumerMessage ¶
func CreateSessionContextWithConsumerMessage(msg mqenv.MQConsumerMessage) SessionContext
CreateSessionContextWithConsumerMessage SessionContext
func CreateSessionContextWithEvent ¶
func CreateSessionContextWithEvent(event events.Event) SessionContext
CreateSessionContextWithEvent SessionContext
type StatusCodeResultType ¶
type StatusCodeResultType interface {
StatusCode() int
}
StatusCodeResultType interface