Skip to content

Commit 983853d

Browse files
author
Roman Golov
committed
Use public types in signatures.
1 parent 0e6e864 commit 983853d

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

query/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Client interface {
1717
// - retry operation returned nil as error
1818
//
1919
// Warning: if context without deadline or cancellation func than Do can run indefinitely.
20-
Do(ctx context.Context, op Operation, opts ...options.DoOption) error
20+
Do(ctx context.Context, op Operation, opts ...DoOption) error
2121

2222
// DoTx provide the best effort for execute transaction.
2323
//
@@ -31,7 +31,7 @@ type Client interface {
3131
// If op TxOperation returns nil - transaction will be committed
3232
// If op TxOperation return non nil - transaction will be rollback
3333
// Warning: if context without deadline or cancellation func than DoTx can run indefinitely
34-
DoTx(ctx context.Context, op TxOperation, opts ...options.DoTxOption) error
34+
DoTx(ctx context.Context, op TxOperation, opts ...DoTxOption) error
3535

3636
// Execute is a simple executor with retries
3737
//
@@ -73,12 +73,12 @@ type (
7373

7474
Session
7575
}
76+
DoOption = options.DoOption
77+
DoTxOption = options.DoTxOption
7678
bothDoAndDoTxOption interface {
77-
options.DoOption
78-
options.DoTxOption
79+
DoOption
80+
DoTxOption
7981
}
80-
DoOption = options.DoOption
81-
DoTxOption = options.DoTxOption
8282
)
8383

8484
func WithIdempotent() bothDoAndDoTxOption {

query/transaction.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type (
4747
)
4848

4949
// BeginTx returns selector transaction control option
50-
func BeginTx(opts ...tx.Option) tx.ControlOption {
50+
func BeginTx(opts ...TransactionOption) tx.ControlOption {
5151
return tx.BeginTx(opts...)
5252
}
5353

@@ -112,26 +112,26 @@ func TxSettings(opts ...tx.Option) TransactionSettings {
112112
return opts
113113
}
114114

115-
func WithDefaultTxMode() tx.Option {
115+
func WithDefaultTxMode() TransactionOption {
116116
return tx.WithDefaultTxMode()
117117
}
118118

119-
func WithSerializableReadWrite() tx.Option {
119+
func WithSerializableReadWrite() TransactionOption {
120120
return tx.WithSerializableReadWrite()
121121
}
122122

123-
func WithSnapshotReadOnly() tx.Option {
123+
func WithSnapshotReadOnly() TransactionOption {
124124
return tx.WithSnapshotReadOnly()
125125
}
126126

127-
func WithStaleReadOnly() tx.Option {
127+
func WithStaleReadOnly() TransactionOption {
128128
return tx.WithStaleReadOnly()
129129
}
130130

131131
func WithInconsistentReads() tx.OnlineReadOnlyOption {
132132
return tx.WithInconsistentReads()
133133
}
134134

135-
func WithOnlineReadOnly(opts ...tx.OnlineReadOnlyOption) tx.Option {
135+
func WithOnlineReadOnly(opts ...tx.OnlineReadOnlyOption) TransactionOption {
136136
return tx.WithOnlineReadOnly(opts...)
137137
}

0 commit comments

Comments
 (0)