bearer/bearer.go
func NewTokenSource(signer jwt.Signer, tokenURL string, ctxt context.Context, opts ...Option) (*Bearer, error) {
	var err error

	b := &Bearer{
		signer:   signer,
		tokenURL: tokenURL,
		context:  ctxt,
		claims:   make(map[string]interface{}),
	}

	// apply opts
	for _, o := range opts {
		if err = o(b); err != nil {
			return nil, fmt.Errorf("jwt/bearer: %v", err)
		}
	}

	return b, nil
}
func NewTokenSource(signer jwt.Signer, tokenURL string, ctxt context.Context, opts ...Option) (*Bearer, error) {
	var err error

	b := &Bearer{
		signer:   signer,
		tokenURL: tokenURL,
		context:  ctxt,
		claims:   make(map[string]interface{}),
	}

	// apply opts
	for _, o := range opts {
		if err = o(b); err != nil {
			return nil, fmt.Errorf("jwt/bearer: %v", err)
		}
	}

	return b, nil
}
func NewTokenSource ( signer jwt . Signer , tokenURL string , ctxt context . Context , opts ... Option ) ( * Bearer , error ) { var err error b := & Bearer { signer : signer , tokenURL : tokenURL , context : ctxt , claims : make ( map [ string ] interface { } ) , } // apply opts for _ , o := range opts { if err = o ( b ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } } return b , nil }
// NewTokenSource creates a oauth2.TokenSource that generates auth tokens
// redeemed using the JWT Bearer Grant assertion auth flow using the supplied
// jwt.Signer. A token redemption will be invoked at the tokenURL using the
// supplied context.
//
// Use the Claim option to pass additional claims to the token source.
NewTokenSource creates a oauth2 . TokenSource that generates auth tokens redeemed using the JWT Bearer Grant assertion auth flow using the supplied jwt . Signer . A token redemption will be invoked at the tokenURL using the supplied context . Use the Claim option to pass additional claims to the token source .