Documentation ¶
Index ¶
- type Repository
- type RepositoryInstance
- func (r RepositoryInstance) Create(ctx context.Context, article domain.Article) error
- func (r RepositoryInstance) Find(ctx context.Context, query map[string]interface{}) (*domain.Article, error)
- func (r RepositoryInstance) FindAll(ctx context.Context, filter map[string]interface{}) ([]*domain.Article, error)
- type Service
- type ServiceInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Create(context.Context, domain.Article) error Find(context.Context, map[string]interface{}) (*domain.Article, error) FindAll(context.Context, map[string]interface{}) ([]*domain.Article, error) }
TODO: For demo only and more interface in the future
type RepositoryInstance ¶
type RepositoryInstance struct { TableName string // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(db *gorm.DB) *RepositoryInstance
func (RepositoryInstance) Create ¶
TODO: Add instrumentation to monitor performance (Newrelic, StatsD)
type ServiceInstance ¶
type ServiceInstance struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository) ServiceInstance
Click to show internal directories.
Click to hide internal directories.