MCPcopy
hub / github.com/olric-data/olric / Command

Method Command

internal/protocol/dmap.go:80–116  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

78}
79
80func (p *Put) Command(ctx context.Context) *redis.StatusCmd {
81 var args []interface{}
82 args = append(args, DMap.Put)
83 args = append(args, p.DMap)
84 args = append(args, p.Key)
85 args = append(args, p.Value)
86
87 if p.EX != 0 {
88 args = append(args, "EX")
89 args = append(args, p.EX)
90 }
91
92 if p.PX != 0 {
93 args = append(args, "PX")
94 args = append(args, p.PX)
95 }
96
97 if p.EXAT != 0 {
98 args = append(args, "EXAT")
99 args = append(args, p.EXAT)
100 }
101
102 if p.PXAT != 0 {
103 args = append(args, "PXAT")
104 args = append(args, p.PXAT)
105 }
106
107 if p.NX {
108 args = append(args, "NX")
109 }
110
111 if p.XX {
112 args = append(args, "XX")
113 }
114
115 return redis.NewStatusCmd(ctx, args...)
116}
117
118func ParsePutCommand(cmd redcon.Command) (*Put, error) {
119 if len(cmd.Args) < 4 {

Callers 15

writePutCommandMethod · 0.95
scanOnOwnersMethod · 0.45
PutMethod · 0.45
GetMethod · 0.45
DeleteMethod · 0.45
ExpireMethod · 0.45

Calls

no outgoing calls