// SetUsernameToTokenInStore sets the username associated with the token. func (t *Token) SetUsernameToTokenInStore(username string) (err error) { hash := sha256.Sum256([]byte(t.accessToken)) err = database.Store(TokenBucketName, fmt.Sprintf("%x", hash), username) return }
// Save will store the code review to the database. func (cr *CodeReview) Save() error { return database.Store(CodeReviewBucketName, strconv.Itoa(cr.ID), cr) }