MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / stringGetSet

Function stringGetSet

cmd/client/string.go:90–103  ·  view source on GitHub ↗

GetSet sets the value of a key and returns its old value

(c *grumble.Context)

Source from the content-addressed store, hash-verified

88
89// GetSet sets the value of a key and returns its old value
90func stringGetSet(c *grumble.Context) error {
91 key := c.Args.String("key")
92 value := c.Args.String("value")
93 if key == "" || value == "" {
94 fmt.Println("key or value is empty")
95 return nil
96 }
97 oldValue, err := newClient().GetSet(key, value)
98 if err != nil {
99 return err
100 }
101 fmt.Println(oldValue)
102 return nil
103}
104
105func stringAppend(c *grumble.Context) error {
106 key := c.Args.String("key")

Callers

nothing calls this directly

Calls 3

newClientFunction · 0.85
GetSetMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected