Skip to content

Multiple databases support #62

Discussion options

You must be logged in to vote

Hi @deividaspetraitis. If the sqlite.UserService needed to interact with an AuthService then I'd probably attach it as a field on sqlite.UserService:

package sqlite

type UserService struct {
	AuthService myapp.AuthService
}

Then I'd attach the concrete implementation in the cmd/myapp/main.go so that the sqlite implementation wouldn't need to know anything about the other database implementation.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@deividaspetraitis
Comment options

Answer selected by benbjohnson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants