Skip to content

MWM-io/gapi-addons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GAPI Addons

A repo with a list of additional packages to improve GAPI features :

Description Doc
Auth middleware for GCloud PkgGoDev

How it works

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]",
        },
    }
    ...
}