store: remove unneded options
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
6a7433ba2a
commit
9fc0b5f88b
@ -88,15 +88,8 @@ func Table(t string) Option {
|
|||||||
|
|
||||||
// ReadOptions configures an individual Read operation
|
// ReadOptions configures an individual Read operation
|
||||||
type ReadOptions struct {
|
type ReadOptions struct {
|
||||||
Database, Table string
|
Database string
|
||||||
// Prefix returns all records that are prefixed with key
|
Table string
|
||||||
Prefix bool
|
|
||||||
// Suffix returns all records that have the suffix key
|
|
||||||
Suffix bool
|
|
||||||
// Limit limits the number of returned records
|
|
||||||
Limit uint
|
|
||||||
// Offset when combined with Limit supports pagination
|
|
||||||
Offset uint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadOption sets values in ReadOptions
|
// ReadOption sets values in ReadOptions
|
||||||
@ -110,34 +103,6 @@ func ReadFrom(database, table string) ReadOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadPrefix returns all records that are prefixed with key
|
|
||||||
func ReadPrefix() ReadOption {
|
|
||||||
return func(r *ReadOptions) {
|
|
||||||
r.Prefix = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadSuffix returns all records that have the suffix key
|
|
||||||
func ReadSuffix() ReadOption {
|
|
||||||
return func(r *ReadOptions) {
|
|
||||||
r.Suffix = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadLimit limits the number of responses to l
|
|
||||||
func ReadLimit(l uint) ReadOption {
|
|
||||||
return func(r *ReadOptions) {
|
|
||||||
r.Limit = l
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadOffset starts returning responses from o. Use in conjunction with Limit for pagination
|
|
||||||
func ReadOffset(o uint) ReadOption {
|
|
||||||
return func(r *ReadOptions) {
|
|
||||||
r.Offset = o
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// WriteOptions configures an individual Write operation
|
// WriteOptions configures an individual Write operation
|
||||||
// If Expiry and TTL are set TTL takes precedence
|
// If Expiry and TTL are set TTL takes precedence
|
||||||
type WriteOptions struct {
|
type WriteOptions struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user