top

Package admindb handles the admin storage on SQLite3.

Auto Migration

Table schemas will be auto migrated on db opening, that means tables will be automatically created on the first time banshee starts.

Persistence

Users, Rules and Projects are stored on disk in sqlite3, the relation between them is:

User:Project    N:M
Rule:Project    N:1

To get gorm DB handle:

adminDBInstance.DB()

Rules Cache

To access rules faster in detector, rules are cached in memory, in a safemap with RWLock.

To get the rulesCache handle:

adminDBInstance.RulesCache

Imported by 7 package(s)

  1. github.com/eleme/banshee/storage
  2. github.com/hit9/banshee/storage
  3. github.com/mantyr/banshee/storage
  4. github.com/wayslog/banshee/storage
  5. github.com/wooparadog/banshee/storage
  6. github.com/yujinqiu/banshee/storage
  7. github.com/zhaojkun/banshee/storage

Imports 5 package(s)

  1. github.com/eleme/banshee/util/log
  2. github.com/eleme/banshee/util/safemap
  3. github.com/jinzhu/gorm
  4. github.com/mattn/go-sqlite3
  5. github.com/eleme/banshee/models

Test imports 1 package(s)

  1. github.com/eleme/banshee/util