[go-nuts] db interface design

2018-05-20 Thread yang sheng
Hi I am trying to practice golang and have some questions regarding to interface design. Say I want to create a simple app to store the book and its author info. I am planning to create interfaces so that I can use different db driver (mysql/mongo/redis...) as long as if they implemented DB

Re: [go-nuts] db interface design

2018-05-21 Thread yang sheng
On Monday, May 21, 2018 at 3:47:59 AM UTC-4, Sergey Kamardin wrote: > > > 1. there are a lot of similar functions, for example NewBook and > NewAuthor. > > The difference is type of argument passed into the function. Is it a > good > > idea to combine those 2 functions with a generic

[go-nuts] choose buffered channel or unbuffered?

2018-02-12 Thread yang sheng
I am trying to design a small app to send emails (stored in MongoDB) using golang utilizing goroutine and channel and this is the first time i use golang. There are 2 types of worker in each server (Retriever and Sender). A single retriever will periodically (every few seconds) query