MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / cmdSET

Function cmdSET

strings.go:662–672  ·  view source on GitHub ↗

This is different from the RESP standard. It needs to enrich the algorithm to support more atomic instructions.

(m uhaha.Machine, args []string)

Source from the content-addressed store, hash-verified

660
661// This is different from the RESP standard. It needs to enrich the algorithm to support more atomic instructions.
662func cmdSET(m uhaha.Machine, args []string) (interface{}, error) {
663 if len(args) != 3 {
664 return nil, uhaha.ErrWrongNumArgs
665 }
666
667 if err := ldb.Set([]byte(args[1]), []byte(args[2])); err != nil {
668 return nil, err
669 }
670
671 return redcon.SimpleString("OK"), nil
672}
673
674// Setex is rewritten as setexat to avoid the exception of raft log playback
675func cmdSETEX(m uhaha.Machine, args []string) (interface{}, error) {

Callers

nothing calls this directly

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected