refactor
This commit is contained in:
11
api/utils.go
11
api/utils.go
@@ -8,11 +8,22 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"reichard.io/antholume/database"
|
||||
"reichard.io/antholume/graph"
|
||||
"reichard.io/antholume/metadata"
|
||||
)
|
||||
|
||||
func getAuthData(ctx *gin.Context) (*authData, error) {
|
||||
if data, ok := ctx.Get("Authorization"); ok {
|
||||
var auth *authData
|
||||
if auth, ok = data.(*authData); ok {
|
||||
return auth, nil
|
||||
}
|
||||
}
|
||||
return nil, errors.New("could not acquire auth data")
|
||||
}
|
||||
|
||||
// getTimeZones returns a string slice of IANA timezones.
|
||||
func getTimeZones() []string {
|
||||
return []string{
|
||||
|
||||
Reference in New Issue
Block a user