Models for translated content coming from multiple providers.
go get github.com/altipla-consulting/content
This library has no external dependencies outside the Go standard library.
You can use the types of this package in your models structs when working with database/sql
:
type MyModel struct {
ID int64 `db:"id,omitempty"`
Name content.Translated `db:"name"`
Description content.Translated `db:"description"`
Description content.Provider `db:"description"`
}
You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt
.
Start the test database:
docker-compose up -d database
Install test libs:
go get github.com/stretchr/testify
go get upper.io/db.v3
Run the tests:
go test
Shutdown the database when finished testing:
docker-compose stop database