func (s *Session) Save(ctx *context.Context) error { var buf bytes.Buffer if err := s.Encode(&buf); err != nil { return err } wo := rocksdb.NewWriteOptions() defer wo.Close() return ctx.Db.Put(wo, s.Key, buf.Bytes()) }
func (u *User) Save(ctx *context.Context) error { var buf bytes.Buffer if err := u.Encode(&buf); err != nil { return err } wo := rocksdb.NewWriteOptions() defer wo.Close() return ctx.Db.Put(wo, userKeyBytes(u.Id), buf.Bytes()) }
func DeleteSession(ctx *context.Context, id []byte) error { wo := rocksdb.NewWriteOptions() defer wo.Close() return ctx.Db.Delete(wo, id) }