Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindiu authored and actions-user committed Oct 2, 2020
1 parent f45dcf0 commit fd108ff
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 252 deletions.
12 changes: 12 additions & 0 deletions internal/db/nosql/cassandra/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,22 +366,34 @@ func WithSocketKeepalive(socketKeepalive string) Option {
}
}

// WithMaxPreparedStmts returns the option to set the max prepared statement
func WithMaxPreparedStmts(maxPreparedStmts int) Option {
return func(c *client) error {
if maxPreparedStmts < 0 {
return errors.NewErrInvalidOption("maxPreparedStmts", maxPreparedStmts)
}
c.maxPreparedStmts = maxPreparedStmts
return nil
}
}

// WithMaxRoutingKeyInfo returns the option to set the max routing key info
func WithMaxRoutingKeyInfo(maxRoutingKeyInfo int) Option {
return func(c *client) error {
if maxRoutingKeyInfo < 0 {
return errors.NewErrInvalidOption("maxRoutingKeyInfo", maxRoutingKeyInfo)
}
c.maxRoutingKeyInfo = maxRoutingKeyInfo
return nil
}
}

// WithPageSize returns the option to set the page size
func WithPageSize(pageSize int) Option {
return func(c *client) error {
if pageSize < 0 {
return errors.NewErrInvalidOption("pageSize", pageSize)
}
c.pageSize = pageSize
return nil
}
Expand Down
Loading

0 comments on commit fd108ff

Please sign in to comment.