Skip to content

Commit

Permalink
fix breaking todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Oct 11, 2023
1 parent 0abb06b commit 3c03a02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions sync/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"time"
)

// Options is the functional option that is applied to the Syner instance
// Option is the functional option that is applied to the Syner instance
// to configure its parameters.
// TODO(@Wondertan): rename to single Option in some breaking release
type Options func(*Parameters)
type Option func(*Parameters)

// Parameters is the set of parameters that must be configured for the syncer.
type Parameters struct {
Expand Down Expand Up @@ -47,30 +46,30 @@ func (p *Parameters) Validate() error {

// WithBlockTime is a functional option that configures the
// `blockTime` parameter.
func WithBlockTime(duration time.Duration) Options {
func WithBlockTime(duration time.Duration) Option {
return func(p *Parameters) {
p.blockTime = duration
}
}

// WithRecencyThreshold is a functional option that configures the
// `recencyThreshold` parameter.
func WithRecencyThreshold(threshold time.Duration) Options {
func WithRecencyThreshold(threshold time.Duration) Option {
return func(p *Parameters) {
p.recencyThreshold = threshold
}
}

// WithTrustingPeriod is a functional option that configures the
// `TrustingPeriod` parameter.
func WithTrustingPeriod(duration time.Duration) Options {
func WithTrustingPeriod(duration time.Duration) Option {
return func(p *Parameters) {
p.TrustingPeriod = duration
}
}

// WithParams is a functional option that overrides Parameters.
func WithParams(new Parameters) Options {
func WithParams(new Parameters) Option {
return func(old *Parameters) {
*old = new
}
Expand Down
2 changes: 1 addition & 1 deletion sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewSyncer[H header.Header[H]](
getter header.Getter[H],
store header.Store[H],
sub header.Subscriber[H],
opts ...Options,
opts ...Option,
) (*Syncer[H], error) {
params := DefaultParameters()
for _, opt := range opts {
Expand Down

0 comments on commit 3c03a02

Please sign in to comment.