Browse Source

Use api_key on the wire, APIKey in structs

pull/75/head
Luke Barnard 8 years ago
parent
commit
c52245f8d7
  1. 2
      src/github.com/matrix-org/go-neb/services/giphy/giphy.go
  2. 4
      src/github.com/matrix-org/go-neb/services/guggy/guggy.go

2
src/github.com/matrix-org/go-neb/services/giphy/giphy.go

@ -33,7 +33,7 @@ type giphySearch struct {
type giphyService struct { type giphyService struct {
id string id string
serviceUserID string serviceUserID string
APIKey string // beta key is dc6zaTOxFJmzC
APIKey string `json:"api_key"`// beta key is dc6zaTOxFJmzC
} }
func (s *giphyService) ServiceUserID() string { return s.serviceUserID } func (s *giphyService) ServiceUserID() string { return s.serviceUserID }

4
src/github.com/matrix-org/go-neb/services/guggy/guggy.go

@ -28,7 +28,7 @@ type guggyGifResult struct {
type guggyService struct { type guggyService struct {
id string id string
serviceUserID string serviceUserID string
api_key string
APIKey string `json:"api_key"`
} }
func (s *guggyService) ServiceUserID() string { return s.serviceUserID } func (s *guggyService) ServiceUserID() string { return s.serviceUserID }
@ -106,7 +106,7 @@ func (s *guggyService) text2gifGuggy(querySentence string) (*guggyGifResult, err
return nil, err return nil, err
} }
req.Header.Add("Content-Type", "application/json") req.Header.Add("Content-Type", "application/json")
req.Header.Add("apiKey", s.api_key)
req.Header.Add("apiKey", s.APIKey)
res, err := client.Do(req) res, err := client.Do(req)
if res != nil { if res != nil {

Loading…
Cancel
Save