From d7a4cd55f58dc548f6f037d59d5ce605824d3f67 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 10 Jan 2018 22:02:50 +0100 Subject: [PATCH] Package app: Add email address to User object. --- app/user.go | 9 ++++++--- gfitsync.go | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/user.go b/app/user.go index 86c033c..8465c2c 100644 --- a/app/user.go +++ b/app/user.go @@ -11,7 +11,8 @@ import ( ) type User struct { - key *datastore.Key + Email string + key *datastore.Key } type dbUser struct { @@ -35,7 +36,8 @@ func NewUser(ctx context.Context, email string) (*User, error) { } return &User{ - key: datastore.NewKey(ctx, "User", email, 0, nil), + Email: email, + key: datastore.NewKey(ctx, "User", email, 0, nil), }, nil } @@ -50,7 +52,8 @@ func UserByID(ctx context.Context, id string) (*User, error) { } return &User{ - key: keys[0], + Email: keys[0].StringID(), + key: keys[0], }, nil } diff --git a/gfitsync.go b/gfitsync.go index 0007395..898fb98 100644 --- a/gfitsync.go +++ b/gfitsync.go @@ -200,6 +200,6 @@ func handleNotification(ctx context.Context, s *fitbit.Subscription) error { return err } - log.Debugf(ctx, "ActivitySummary(%q) = %+v", s.OwnerID, summary) + log.Debugf(ctx, "ActivitySummary for %s = %+v", u.Email, summary) return nil } -- 2.11.0