Beispiel #1
0
// 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
}
Beispiel #2
0
// Save will store the code review to the database.
func (cr *CodeReview) Save() error {
	return database.Store(CodeReviewBucketName, strconv.Itoa(cr.ID), cr)
}