dbinc.go 701 B

123456789101112131415161718192021222324
  1. package dbinc
  2. /*
  3. dbinc is the interface for all database backend
  4. */
  5. type BackendType int
  6. const (
  7. BackendBoltDB BackendType = iota //Default backend
  8. BackendFSOnly //OpenWRT or RISCV backend
  9. BackendLevelDB //LevelDB backend
  10. )
  11. type Backend interface {
  12. NewTable(tableName string) error
  13. TableExists(tableName string) bool
  14. DropTable(tableName string) error
  15. Write(tableName string, key string, value interface{}) error
  16. Read(tableName string, key string, assignee interface{}) error
  17. KeyExists(tableName string, key string) bool
  18. Delete(tableName string, key string) error
  19. ListTable(tableName string) ([][][]byte, error)
  20. Close()
  21. }