GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Enable optional per-method Context callback. #125

Closed danjacques closed 8 years ago

danjacques commented 8 years ago

Adds an optional callback to Service that allows manipulation of the Context that is passed to the method handler based on the service/method, as well as preliminary request rejection.

Also adds accessor methods to pull the ServiceInfo and MethodInfo from the handler's context.

This avoids the need to place boilerplate code at the beginning of each method handler and enables unified Service-wide security and setup operations.

campoy commented 8 years ago

Implemented by #126