Documentation ¶
Index ¶
- Constants
- func InitServer(dir string) error
- type Server
- type ServerImpl
- func (s *ServerImpl) BatchInsert(attr map[string]string) error
- func (s *ServerImpl) Close() error
- func (s *ServerImpl) FindAll() (map[string]string, error)
- func (s *ServerImpl) FindByKey(key string) (data []byte, err error)
- func (s *ServerImpl) FindByPrefix(pre string) (map[string]string, error)
- func (s *ServerImpl) FindLimit(start, limit string) (map[string]string, error)
- func (s *ServerImpl) Insert(key string, val interface{}) error
- func (s *ServerImpl) Instance() *leveldb.DB
- func (s *ServerImpl) IsExistFromLevelDB(key string) (bool, error)
- func (s *ServerImpl) Open() error
- func (s *ServerImpl) RemoveKeyFromLevelDB(key string) error
Constants ¶
View Source
const ConstLeveldbFileName = "db"
Variables ¶
This section is empty.
Functions ¶
func InitServer ¶
Types ¶
type Server ¶
type Server interface { Open() error Close() error Instance() *leveldb.DB IsExistFromLevelDB(key string) (bool, error) FindByPrefix(pre string) (files map[string]string, err error) FindAll() (map[string]string, error) FindLimit(start, limit string) (data map[string]string, err error) BatchInsert(attr map[string]string) error RemoveKeyFromLevelDB(key string) error Insert(key string, val interface{}) error FindByKey(key string) (data []byte, err error) }
type ServerImpl ¶
type ServerImpl struct {
// contains filtered or unexported fields
}
func (*ServerImpl) BatchInsert ¶
func (s *ServerImpl) BatchInsert(attr map[string]string) error
attr[key]val
func (*ServerImpl) Close ¶
func (s *ServerImpl) Close() error
func (*ServerImpl) FindByPrefix ¶
func (s *ServerImpl) FindByPrefix(pre string) (map[string]string, error)
func (*ServerImpl) FindLimit ¶
func (s *ServerImpl) FindLimit(start, limit string) (map[string]string, error)
比如key是key1-key1000 start = key1 limit = key2 就是从key1-key199 start = key100 limit = key105 就是从key100-key104
func (*ServerImpl) Insert ¶
func (s *ServerImpl) Insert(key string, val interface{}) error
func (*ServerImpl) Instance ¶
func (s *ServerImpl) Instance() *leveldb.DB
func (*ServerImpl) IsExistFromLevelDB ¶
func (s *ServerImpl) IsExistFromLevelDB(key string) (bool, error)
func (*ServerImpl) Open ¶
func (s *ServerImpl) Open() error
func (*ServerImpl) RemoveKeyFromLevelDB ¶
func (s *ServerImpl) RemoveKeyFromLevelDB(key string) error
Click to show internal directories.
Click to hide internal directories.