Skip to content

Commit a8f1a40

Browse files
committed
remove query.bothDoAndDoTxOption
1 parent f91d7ea commit a8f1a40

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

internal/query/options/retry.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
)
99

1010
var (
11-
_ DoOption = retryOptionsOption(nil)
12-
_ DoOption = traceOption{}
11+
_ DoOption = RetryOptionsOption(nil)
12+
_ DoOption = TraceOption{}
1313

14-
_ DoTxOption = retryOptionsOption(nil)
15-
_ DoTxOption = traceOption{}
14+
_ DoTxOption = RetryOptionsOption(nil)
15+
_ DoTxOption = TraceOption{}
1616
_ DoTxOption = doTxSettingsOption{}
1717
)
1818

@@ -35,8 +35,8 @@ type (
3535
txSettings tx.Settings
3636
}
3737

38-
retryOptionsOption []retry.Option
39-
traceOption struct {
38+
RetryOptionsOption []retry.Option
39+
TraceOption struct {
4040
t *trace.Query
4141
}
4242
doTxSettingsOption struct {
@@ -56,19 +56,19 @@ func (s *doTxSettings) TxSettings() tx.Settings {
5656
return s.txSettings
5757
}
5858

59-
func (opt traceOption) applyDoOption(s *doSettings) {
59+
func (opt TraceOption) applyDoOption(s *doSettings) {
6060
s.trace = s.trace.Compose(opt.t)
6161
}
6262

63-
func (opt traceOption) applyDoTxOption(s *doTxSettings) {
63+
func (opt TraceOption) applyDoTxOption(s *doTxSettings) {
6464
opt.applyDoOption(&s.doSettings)
6565
}
6666

67-
func (opts retryOptionsOption) applyDoOption(s *doSettings) {
67+
func (opts RetryOptionsOption) applyDoOption(s *doSettings) {
6868
s.retryOpts = append(s.retryOpts, opts...)
6969
}
7070

71-
func (opts retryOptionsOption) applyDoTxOption(s *doTxSettings) {
71+
func (opts RetryOptionsOption) applyDoTxOption(s *doTxSettings) {
7272
opts.applyDoOption(&s.doSettings)
7373
}
7474

@@ -80,19 +80,19 @@ func WithTxSettings(txSettings tx.Settings) doTxSettingsOption {
8080
return doTxSettingsOption{txSettings: txSettings}
8181
}
8282

83-
func WithIdempotent() retryOptionsOption {
83+
func WithIdempotent() RetryOptionsOption {
8484
return []retry.Option{retry.WithIdempotent(true)}
8585
}
8686

87-
func WithLabel(lbl string) retryOptionsOption {
87+
func WithLabel(lbl string) RetryOptionsOption {
8888
return []retry.Option{retry.WithLabel(lbl)}
8989
}
9090

91-
func WithTrace(t *trace.Query) traceOption {
92-
return traceOption{t: t}
91+
func WithTrace(t *trace.Query) TraceOption {
92+
return TraceOption{t: t}
9393
}
9494

95-
func WithRetryBudget(b budget.Budget) retryOptionsOption {
95+
func WithRetryBudget(b budget.Budget) RetryOptionsOption {
9696
return []retry.Option{retry.WithBudget(b)}
9797
}
9898

query/client.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,23 @@ type (
7373

7474
Session
7575
}
76-
bothDoAndDoTxOption interface {
77-
options.DoOption
78-
options.DoTxOption
79-
}
8076
)
8177

82-
func WithIdempotent() bothDoAndDoTxOption {
78+
func WithIdempotent() options.RetryOptionsOption {
8379
return options.WithIdempotent()
8480
}
8581

86-
func WithTrace(t *trace.Query) bothDoAndDoTxOption {
82+
func WithTrace(t *trace.Query) options.TraceOption {
8783
return options.WithTrace(t)
8884
}
8985

90-
func WithLabel(lbl string) bothDoAndDoTxOption {
86+
func WithLabel(lbl string) options.RetryOptionsOption {
9187
return options.WithLabel(lbl)
9288
}
9389

90+
// WithRetryBudget creates option with external budget
91+
//
9492
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
95-
func WithRetryBudget(b budget.Budget) bothDoAndDoTxOption {
93+
func WithRetryBudget(b budget.Budget) options.RetryOptionsOption {
9694
return options.WithRetryBudget(b)
9795
}

0 commit comments

Comments
 (0)