2024-10-20 07:22:19 +00:00
|
|
|
package directory
|
|
|
|
|
|
|
|
const (
|
|
|
|
CommandMethodGet = "get"
|
|
|
|
CommandMethodPut = "put"
|
|
|
|
CommandMethodPatch = "patch"
|
|
|
|
CommandMethodPost = "post"
|
|
|
|
CommandMethodDelete = "delete"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Command struct {
|
|
|
|
// The unique identifier of the command, different method command can hold the same command id
|
|
|
|
ID string `json:"id"`
|
|
|
|
// The method of the command, such as get, post, others; inspired by RESTful design
|
|
|
|
Method string `json:"method"`
|
|
|
|
// The tags of the command will be used to invoke the pre-command middlewares and post-command middlewares
|
|
|
|
Tags []string `json:"tags"`
|
|
|
|
// The implementation of the command, the handler is the service that will be invoked
|
|
|
|
Handler []*ServiceInstance `json:"handler"`
|
|
|
|
|
2024-10-21 14:47:31 +00:00
|
|
|
RobinIndex uint `json:"robin_index"`
|
2024-10-20 07:22:19 +00:00
|
|
|
}
|