Deprecated marks this group and all its versioned routes as deprecated versions of that endpoint.
(options DeprecationOptions)
| 117 | // Deprecated marks this group and all its versioned routes |
| 118 | // as deprecated versions of that endpoint. |
| 119 | func (g *Group) Deprecated(options DeprecationOptions) *Group { |
| 120 | // store it for future use, e.g. collect all deprecated APIs and notify the developer. |
| 121 | g.deprecation = options |
| 122 | |
| 123 | g.API.UseOnce(func(ctx *context.Context) { |
| 124 | WriteDeprecated(ctx, options) |
| 125 | ctx.Next() |
| 126 | }) |
| 127 | return g |
| 128 | } |
| 129 | |
| 130 | func makeHandler(validate semver.Range) context.Handler { |
| 131 | return func(ctx *context.Context) { |