Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 103 additions & 43 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 4 additions & 33 deletions Gopkg.toml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true
required = ["github.com/jteeuwen/go-bindata"]

[[constraint]]
Expand All @@ -33,6 +8,10 @@ required = ["github.com/jteeuwen/go-bindata"]
branch = "master"
name = "github.com/graph-gophers/graphql-go"

[[constraint]]
name = "github.com/graph-gophers/dataloader"
version = "5.0.0"

[[constraint]]
branch = "master"
name = "github.com/jmoiron/sqlx"
Expand All @@ -57,14 +36,6 @@ required = ["github.com/jteeuwen/go-bindata"]
branch = "master"
name = "golang.org/x/crypto"

[[constraint]]
branch = "master"
name = "golang.org/x/net"

[[constraint]]
name = "gopkg.in/nicksrandall/dataloader.v5"
version = "5.0.0"

[prune]
go-tests = true
unused-packages = true
3 changes: 2 additions & 1 deletion context/configuration.go
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package context

import (
"github.com/spf13/viper"
"log"
"time"

"github.com/spf13/viper"
)

type Config struct {
Expand Down
5 changes: 3 additions & 2 deletions context/db.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package context

import (
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"
"time"

"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
)

func OpenDB(config *Config) (*sqlx.DB, error) {
Expand Down
12 changes: 7 additions & 5 deletions handler/auth.go
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package handler

import (
"context"
"encoding/base64"
"encoding/json"
"errors"
gcontext "github.com/OscarYuen/go-graphql-starter/context"
"github.com/OscarYuen/go-graphql-starter/model"
"github.com/OscarYuen/go-graphql-starter/service"
jwt "github.com/dgrijalva/jwt-go"
"golang.org/x/net/context"
"log"
"net"
"net/http"
"strings"

gcontext "go-graphql-starter/context"
model "go-graphql-starter/model"
service "go-graphql-starter/service"

jwt "github.com/dgrijalva/jwt-go"
)

func Authenticate(h http.Handler) http.Handler {
Expand Down
Loading