-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
43 lines (33 loc) · 924 Bytes
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ddb
import "context"
//go:generate mockgen -source=interface.go -destination=./mocks/mocks.go -package=mocks
type ClientInterface interface {
Deleter
Getter
Putter
Queryer
TransactionPutter
//TransactionWriter
Updater
}
type Deleter interface {
Delete(ctx context.Context, pk, sk string, opts ...Option) error
}
type Getter interface {
Get(ctx context.Context, pk, sk string, out any) error
}
type Putter interface {
Put(ctx context.Context, row any, opts ...Option) error
}
type Queryer interface {
Query(ctx context.Context, keyCond KeyCondition, out any, opts ...Option) error
}
type TransactionPutter interface {
TransactPuts(ctx context.Context, token string, rows ...PutRow) error
}
//type TransactionWriter interface {
// TransactWrite(ctx context.Context, token string, rows ...any) error
//}
type Updater interface {
Update(ctx context.Context, pk, sk string, opts ...Option) error
}