Example #1
0
func (r *AccountRepository) Save(account *core.Account) error {
	result, err := dat.Create(r, account)
	if err != nil {
		log.Printf("Error creating new account: %s", err)
	}
	account.SetID(result.GeneratedKeys[0])

	return err
}
Example #2
0
func (r *TopicRepository) Save(topic *core.Topic) error {
	result, err := dat.Create(r, topic)
	if err != nil {
		log.Printf("Error creating new topic: %s", err)
		return err
	}

	topic.SetID(result.GeneratedKeys[0])

	return nil
}
Example #3
0
func (r *PostRepository) Save(post *core.Post) error {
	result, err := dat.Create(r, post)
	if err != nil {
		log.Printf("Error creating new post: %s", err)
		return err

	}

	post.SetID(result.GeneratedKeys[0])

	return nil
}