Skip to content
This repository was archived by the owner on Oct 8, 2022. It is now read-only.

Commit 5f43e4d

Browse files
author
C
committed
Change service name to InsertionService
Fix `Create()` signature and change name to `Insert`'
1 parent a39365e commit 5f43e4d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

benchttp/service.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package benchttp
22

3-
// StatsService defines the interface to implement by a
4-
// service facade inside the application.
5-
type StatsService interface {
3+
import "github.com/benchttp/worker/stats"
4+
5+
// InsertService defines the interface to implement by a
6+
// data layer facade.
7+
type InsertionService interface {
68
// Create stores stats in database.
7-
Create() error
9+
Insert(stats.Stats, string, string, string) error
810
}

postgresql/stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
// nolint:gocognit
10-
func (s StatsService) Create(statsToStore stats.Stats, statsID, userID, tag string) error {
10+
func (s StatsService) Insert(statsToStore stats.Stats, statsID, userID, tag string) error {
1111
tx, err := s.db.Begin()
1212
if err != nil {
1313
return err

0 commit comments

Comments
 (0)