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

Function soptGeneric

set.go:40–59  ·  view source on GitHub ↗
(args [][]byte, optType byte)

Source from the content-addressed store, hash-verified

38}
39
40func soptGeneric(args [][]byte, optType byte) ([][]byte, error) {
41 if len(args) < 2 {
42 return nil, uhaha.ErrWrongNumArgs
43 }
44
45 var v [][]byte
46 var err error
47 switch optType {
48 case ledis.UnionType:
49 v, err = ldb.SUnion(args[1:]...)
50 case ledis.DiffType:
51 v, err = ldb.SDiff(args[1:]...)
52 case ledis.InterType:
53 v, err = ldb.SInter(args[1:]...)
54 }
55 if err != nil {
56 return nil, err
57 }
58 return v, nil
59}
60
61func soptStoreGeneric(args [][]byte, optType byte) (interface{}, error) {
62 if len(args) < 3 {

Callers 3

cmdSDIFFFunction · 0.85
cmdSINTERFunction · 0.85
cmdSUNIONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected