27 lines
490 B
Go
27 lines
490 B
Go
package routing
|
|
|
|
type RouteInfo struct {
|
|
Method string
|
|
Name string
|
|
Path string
|
|
Description string
|
|
Title string
|
|
}
|
|
|
|
func NewRouteInfo(method, path, description, title string) (*RouteInfo, error) {
|
|
name, err := convertRouteToRouteName(path)
|
|
if err != nil {
|
|
return &RouteInfo{}, err
|
|
}
|
|
|
|
return &RouteInfo{
|
|
Method: method,
|
|
Name: name,
|
|
Path: path,
|
|
Description: description,
|
|
Title: title,
|
|
}, nil
|
|
}
|
|
|
|
type routeInfoKey struct{}
|