MCPcopy Create free account
hub / github.com/dearcode/candy / exist

Method exist

store/friend.go:101–117  ·  view source on GitHub ↗
(uid, fid int64)

Source from the content-addressed store, hash-verified

99}
100
101func (f *friendDB) exist(uid, fid int64) error {
102 v, err := f.db.Get(UserFriendKey(uid, fid), nil)
103 if err != nil {
104 return errors.Trace(err)
105 }
106
107 var r friendRelation
108 if err = json.Unmarshal(v, &r); err != nil {
109 return errors.Trace(err)
110 }
111
112 if r.State != meta.Relation_CONFIRM {
113 return leveldb.ErrNotFound
114 }
115
116 return nil
117}

Callers

nothing calls this directly

Calls 1

UserFriendKeyFunction · 0.85

Tested by

no test coverage detected