Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
felixLam committed Jun 24, 2016
1 parent 79d7b8b commit 176de61
Show file tree
Hide file tree
Showing 55 changed files with 144 additions and 101 deletions.
8 changes: 8 additions & 0 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ func ContextForClient(h *http.Client) context.Context {
}
return context.WithValue(oauth2.NoContext, oauth2.HTTPClient, h)
}

// HTTPClientWithFallBack to be used in all fetch operations.
func HTTPClientWithFallBack(h *http.Client) *http.Client {
if h != nil {
return h
}
return http.DefaultClient
}
5 changes: 3 additions & 2 deletions providers/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ package amazon
import (
"bytes"
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion providers/amazon/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package amazon
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Box.
Expand Down
5 changes: 3 additions & 2 deletions providers/bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ package bitbucket
import (
"bytes"
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion providers/bitbucket/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package bitbucket
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Bitbucket.
Expand Down
5 changes: 3 additions & 2 deletions providers/box/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ package box

import (
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"net/http"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions providers/box/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package box
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Box.
Expand Down
7 changes: 4 additions & 3 deletions providers/cloudfoundry/cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ package cloudfoundry
import (
"bytes"
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"strings"

"github.com/markbates/goth"
"golang.org/x/net/context"
"golang.org/x/oauth2"
)

// Provider is the implementation of `goth.Provider` for accessing Cloud Foundry.
Expand Down
5 changes: 3 additions & 2 deletions providers/cloudfoundry/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"encoding/json"
"errors"
"fmt"
"strings"
"time"

"github.com/markbates/goth"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"strings"
"time"
)

// Session stores data during the auth process with Box.
Expand Down
5 changes: 3 additions & 2 deletions providers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package digitalocean
import (
"bytes"
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions providers/digitalocean/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package digitalocean
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with DigitalOcean.
Expand Down
5 changes: 3 additions & 2 deletions providers/dropbox/dropbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ package dropbox
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"net/http"
"strings"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions providers/facebook/facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion providers/facebook/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package facebook
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Facebook.
Expand Down
3 changes: 2 additions & 1 deletion providers/faux/faux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ package faux

import (
"encoding/json"
"strings"

"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
)

// Provider is used only for testing.
Expand Down
5 changes: 3 additions & 2 deletions providers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

// These vars define the Authentication, Token, and API URLS for GitHub. If
Expand Down
4 changes: 2 additions & 2 deletions providers/github/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package github
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Github.
Expand Down
5 changes: 3 additions & 2 deletions providers/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ package gitlab
import (
"bytes"
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions providers/gitlab/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package gitlab
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Box.
Expand Down
4 changes: 2 additions & 2 deletions providers/gplus/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package gplus
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Facebook.
Expand Down
5 changes: 3 additions & 2 deletions providers/heroku/heroku.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ package heroku

import (
"encoding/json"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"net/http"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions providers/heroku/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package heroku
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"
"time"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Box.
Expand Down
1 change: 0 additions & 1 deletion providers/influxcloud/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"strings"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

// Session stores data during the auth process with Github.
Expand Down
6 changes: 4 additions & 2 deletions providers/instagram/instagram.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"io/ioutil"
"net/http"
"net/url"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

var (
Expand Down Expand Up @@ -144,6 +145,7 @@ func newConfig(p *Provider, scopes []string) *oauth2.Config {
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, errors.New("Refresh token is not provided by instagram")
}

//RefreshTokenAvailable refresh token is not provided by instagram
func (p *Provider) RefreshTokenAvailable() bool {
return false
Expand Down
4 changes: 2 additions & 2 deletions providers/instagram/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package instagram
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"strings"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Instagram
Expand Down
5 changes: 3 additions & 2 deletions providers/lastfm/lastfm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"encoding/xml"
"errors"
"fmt"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io/ioutil"
"net/http"
"net/url"
"sort"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion providers/lastfm/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package lastfm
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"strings"

"github.com/markbates/goth"
)

// Session stores data during the auth process with Lastfm.
Expand Down
5 changes: 3 additions & 2 deletions providers/linkedin/linkedin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ package linkedin
import (
"encoding/json"
"errors"
"github.com/markbates/goth"
"golang.org/x/oauth2"
"io"
"net/http"
"net/url"

"github.com/markbates/goth"
"golang.org/x/oauth2"
)

//more details about linkedin fields: https://developer.linkedin.com/documents/profile-fields
Expand Down
Loading

0 comments on commit 176de61

Please sign in to comment.