Skip to content

Commit

Permalink
fix: set a prefix to the kv keys function via WithPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
davemooreuws committed Jun 27, 2024
1 parent c165e3d commit e26953a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api/keyvalue/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ import (
v1 "github.com/nitrictech/nitric/core/pkg/proto/kvstore/v1"
)

type ScanKeysOption = func(*v1.KvStoreScanKeysRequest)
type ScanKeysRequest = v1.KvStoreScanKeysRequest

type ScanKeysOption = func(*ScanKeysRequest)

// Apply a prefix to the scan keys request
func WithPrefix(prefix string) ScanKeysOption {
return func(req *ScanKeysRequest) {
req.Prefix = prefix
}
}

// TODO: maybe move keystream to separate file
type KeyStream struct {
Expand Down

0 comments on commit e26953a

Please sign in to comment.