aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/google/go-github/github/repos_traffic.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-10-31 16:36:17 +0000
committerNiall Sheridan <nsheridan@gmail.com>2016-10-31 16:40:08 +0000
commite0a1ccb64a637673195804513902cba6b1d4e97c (patch)
treeabc1598be28cda231d92cda8fb10b49eeb564c29 /vendor/github.com/google/go-github/github/repos_traffic.go
parent7bad329d417f19ba4aae2b4607281c2bc5df8ad7 (diff)
Update dependencies
Diffstat (limited to 'vendor/github.com/google/go-github/github/repos_traffic.go')
-rw-r--r--vendor/github.com/google/go-github/github/repos_traffic.go31
1 files changed, 4 insertions, 27 deletions
diff --git a/vendor/github.com/google/go-github/github/repos_traffic.go b/vendor/github.com/google/go-github/github/repos_traffic.go
index b6c8d83..9688b58 100644
--- a/vendor/github.com/google/go-github/github/repos_traffic.go
+++ b/vendor/github.com/google/go-github/github/repos_traffic.go
@@ -5,11 +5,7 @@
package github
-import (
- "fmt"
- "strconv"
- "time"
-)
+import "fmt"
// TrafficReferrer represent information about traffic from a referrer .
type TrafficReferrer struct {
@@ -26,30 +22,11 @@ type TrafficPath struct {
Uniques *int `json:"uniques,omitempty"`
}
-// TimestampMS represents a timestamp as used in datapoint.
-//
-// It's only used to parse the result given by the API which are unix timestamp in milliseonds.
-type TimestampMS struct {
- time.Time
-}
-
-// UnmarshalJSON parse unix timestamp.
-func (t *TimestampMS) UnmarshalJSON(b []byte) error {
- s := string(b)
- i, err := strconv.ParseInt(s, 10, 64)
- if err != nil {
- return err
- }
- // We can drop the reaminder as returned values are days and it will always be 0
- *t = TimestampMS{time.Unix(i/1000, 0)}
- return nil
-}
-
// TrafficData represent information about a specific timestamp in views or clones list.
type TrafficData struct {
- Timestamp *TimestampMS `json:"timestamp,omitempty"`
- Count *int `json:"count,omitempty"`
- Uniques *int `json:"uniques,omitempty"`
+ Timestamp *Timestamp `json:"timestamp,omitempty"`
+ Count *int `json:"count,omitempty"`
+ Uniques *int `json:"uniques,omitempty"`
}
// TrafficViews represent information about the number of views in the last 14 days.