A repo with a list of additional packages to improve GAPI features :
Description | Doc |
---|---|
Auth middleware for GCloud |
First choose your package(s) and add it using go modules, here is an example for auth.GCloudServiceAccount:
$ go get github.com/mwm-io/gapi-addons/gcloud/middleware/auth@latest
The use it in you code:
package main
import (
...
github.com/mwm-io/gapi-addons/gcloud/middleware/auth
)
type myHandler struct {
handler.WithMiddlewares
}
// NewHandler is your handler factory
func NewHandler() handler.Handler {
var h myHandler
h.MiddlewareList = []handler.Middleware{
auth.GCloudServiceAccount{
ServiceAccount: "[email protected]",
},
}
...
}