Skip to content

Commit

Permalink
feat!: Rename SortedSet Name -> Value (#127)
Browse files Browse the repository at this point in the history
As per the Valentines Day Name Massacre.
  • Loading branch information
schwern authored and cprice404 committed Mar 14, 2023
1 parent 84a16c3 commit f6f0c7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/sortedset-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func main() {
CacheName: cacheName,
SetName: setName,
Elements: []*momento.SortedSetScoreRequestElement{{
Name: momento.StringBytes{Text: fmt.Sprintf("element-%d", i)},
Value: momento.StringBytes{Text: fmt.Sprintf("element-%d", i)},
Score: float64(i),
}},
})
Expand Down Expand Up @@ -104,7 +104,7 @@ func displayElements(setName string, resp momento.SortedSetFetchResponse) {
switch r := resp.(type) {
case *momento.SortedSetFetchHit:
for _, e := range r.Elements {
fmt.Printf("setName: %s, elementName: %s, score: %f\n", setName, e.Name, e.Score)
fmt.Printf("setName: %s, elementName: %s, score: %f\n", setName, e.Value, e.Score)
}
fmt.Println("")
case *momento.SortedSetFetchMiss:
Expand Down
4 changes: 2 additions & 2 deletions momento/sorted_set_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
//////// Response

type SortedSetElement struct {
Name []byte
Value []byte
Score float64
}
type SortedSetFetchResponse interface {
Expand Down Expand Up @@ -129,7 +129,7 @@ func sortedSetGrpcElementToModel(grpcSetElements []*pb.XSortedSetElement) []*Sor
var returnList []*SortedSetElement
for _, element := range grpcSetElements {
returnList = append(returnList, &SortedSetElement{
Name: element.Name,
Value: element.Name,
Score: element.Score,
})
}
Expand Down
4 changes: 2 additions & 2 deletions momento/sorted_set_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (SortedSetPutSuccess) isSortedSetPutResponse() {}
///////// Request

type SortedSetScoreRequestElement struct {
Name Bytes
Value Bytes
Score float64
}

Expand Down Expand Up @@ -77,7 +77,7 @@ func convertSortedSetElementToGrpc(modelSetElements []*SortedSetScoreRequestElem
var returnList []*pb.XSortedSetElement
for _, el := range modelSetElements {
returnList = append(returnList, &pb.XSortedSetElement{
Name: el.Name.AsBytes(),
Name: el.Value.AsBytes(),
Score: el.Score,
})
}
Expand Down

0 comments on commit f6f0c7a

Please sign in to comment.