Documentation
¶
Index ¶
- func ConfigureGinCORS(router *gin.Engine, allowedOrigins []string, allowMethods []string, ...)
- func CreateAuth0JWTValidationGinMiddleware(auth0Domain string, audiences []string, algorithm validator.SignatureAlgorithm, ...) func(c *gin.Context)
- func GetAccessToken(auth0Domain, m2mClientID, m2mClientSecret, apiAudience string) (string, error)
- func GetClaims(ctx context.Context) *validator.ValidatedClaims
- func GinAccessLogMiddleware(c *gin.Context)
- func GraphErrorPresenter(ctx context.Context, e error) *gqlerror.Error
- func GraphPanicRecoverer(_ context.Context, p interface{}) error
- func HasScope(scopes, expectedScope string) bool
- func InitGinPackage(devMode bool)
- func NewGin() *gin.Engine
- type CORSConfig
- type GraphUserError
- type HTTPConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureGinCORS ¶
func CreateAuth0JWTValidationGinMiddleware ¶ added in v0.0.2
func CreateAuth0JWTValidationGinMiddleware( auth0Domain string, audiences []string, algorithm validator.SignatureAlgorithm, customClaimsFunc func() validator.CustomClaims, tokenExtractors ...jwtmiddleware.TokenExtractor) func(c *gin.Context)
func GetAccessToken ¶ added in v0.0.2
func GinAccessLogMiddleware ¶
func GraphErrorPresenter ¶ added in v0.0.3
func GraphPanicRecoverer ¶ added in v0.0.3
func InitGinPackage ¶
func InitGinPackage(devMode bool)
Types ¶
type CORSConfig ¶
type CORSConfig struct { AllowedOrigins []string `` /* 241-byte string literal not displayed */ AllowMethods []string `` /* 219-byte string literal not displayed */ AllowHeaders []string `` /* 258-byte string literal not displayed */ DisableCredentials bool `` /* 216-byte string literal not displayed */ ExposeHeaders []string `` /* 215-byte string literal not displayed */ MaxAge time.Duration `` /* 215-byte string literal not displayed */ }
func (*CORSConfig) Configure ¶
func (c *CORSConfig) Configure(router *gin.Engine)
type GraphUserError ¶ added in v0.0.3
type GraphUserError struct {
// contains filtered or unexported fields
}
func (*GraphUserError) Error ¶ added in v0.0.3
func (e *GraphUserError) Error() string
func (*GraphUserError) Is ¶ added in v0.0.3
func (e *GraphUserError) Is(err error) bool
func (*GraphUserError) Unwrap ¶ added in v0.0.3
func (e *GraphUserError) Unwrap() error
type HTTPConfig ¶
type HTTPConfig struct { Port int `env:"PORT" value-name:"PORT" long:"port" description:"Port to listen on" default:"8000"` CORS CORSConfig `group:"cors" namespace:"cors" env-namespace:"CORS"` }
Click to show internal directories.
Click to hide internal directories.