Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GinOrderService ¶
type GinOrderService struct {
// contains filtered or unexported fields
}
Adapter for the OrderService, exposes the service's endpoints as HTTP routes on a gin server
func NewGinAdapter ¶
func NewGinAdapter(svc orders.OrderService, logger *zap.SugaredLogger) *GinOrderService
func (*GinOrderService) RegisterRoutes ¶
func (gos *GinOrderService) RegisterRoutes(engine *gin.Engine)
type MockOrderRepo ¶
Implementation of OrderRepository used in unit tests TODO: Look into https://github.com/vektra/mockery for auto-generating mock objects
type PostgresOrderRepo ¶
type PostgresOrderRepo struct {
// contains filtered or unexported fields
}
Implementation of OrderRepository using a postgres database as the storage mechanism.
NOTE: this repo does not bootstrap the tables it uses, look at postgres/migrations.go for the migration which creates the order table. In a bigger project, each domain module would bootstrap its own tables when the adapter is initialized - using a different schema for each domain module.
func NewPostgresOrderRepo ¶
func NewPostgresOrderRepo(conn *pgx.Conn, logger *zap.SugaredLogger) *PostgresOrderRepo
type SqliteOrderRepo ¶
type SqliteOrderRepo struct {
// contains filtered or unexported fields
}
func NewSqliteOrderRepo ¶
func NewSqliteOrderRepo(db *sql.DB, logger *zap.SugaredLogger) *SqliteOrderRepo
Click to show internal directories.
Click to hide internal directories.