func (s OAuthGrantTypeSet) Has(t OAuthGrantType) bool {
	_, ok := s[t]
	return ok
}
Has returns true if the given grant type is in the receiving set.
package disco
import (
	"fmt"
	"net/url"
	"strings"
	"golang.org/x/oauth2"
)
type OAuthClient struct {
	ID string
	AuthorizationURL *url.URL
	TokenURL *url.URL
	MinPort, MaxPort uint16
	SupportedGrantTypes OAuthGrantTypeSet
}
func (c *OAuthClient) Endpoint() oauth2.Endpoint {
	ep := oauth2.Endpoint{
		AuthStyle: oauth2.AuthStyleInParams,
	}
	if c.AuthorizationURL != nil {
		ep.AuthURL = c.AuthorizationURL.String()
	}
	if c.TokenURL != nil {
		ep.TokenURL = c.TokenURL.String()
	}
	return ep
}
type OAuthGrantType string
const (
	OAuthAuthzCodeGrant = OAuthGrantType("authz_code")
	OAuthOwnerPasswordGrant = OAuthGrantType("password")
)
func (t OAuthGrantType) UsesAuthorizationEndpoint() bool {
	switch t {
	case OAuthAuthzCodeGrant:
		return true
	case OAuthOwnerPasswordGrant:
		return false
	default:
		return false
	}
}
func (t OAuthGrantType) UsesTokenEndpoint() bool {
	switch t {
	case OAuthAuthzCodeGrant:
		return true
	case OAuthOwnerPasswordGrant:
		return true
	default:
		return false
	}
}
type OAuthGrantTypeSet map[OAuthGrantType]struct{}
func NewOAuthGrantTypeSet(keywords ...string) OAuthGrantTypeSet {
	ret := make(OAuthGrantTypeSet, len(keywords))
	for _, kw := range keywords {
		ret[OAuthGrantType(kw)] = struct{}{}
	}
	return ret
}