Example #1
0
// GetUsernameFromTokenInStore gets the username associated with the token.
func (t *Token) GetUsernameFromTokenInStore() (user string, err error) {
	hash := sha256.Sum256([]byte(t.accessToken))
	err = database.Get(TokenBucketName, fmt.Sprintf("%x", hash), &user, true)

	return user, err
}
Example #2
0
func (cr *CodeReview) loadStoredData(lock bool) error {
	return database.Get(CodeReviewBucketName, strconv.Itoa(cr.ID), cr, true)
}