Documentation ¶
Index ¶
- Variables
- func CheckIP(ip *models.IP) bool
- func CheckProxy(ip *models.IP)
- func CheckProxyDB()
- func ProxyAdd(ip *models.IP)
- func ProxyDel(ip *models.IP)
- func ProxyFind(value string) (ip *models.IP)
- func ProxyRandom() (ip *models.IP)
- type Storage
- func (s *Storage) Count() int
- func (s *Storage) Create(item interface{}) error
- func (s *Storage) Delete(ip *models.IP) error
- func (s *Storage) FindAll(value string) ([]*models.IP, error)
- func (s *Storage) GetAll() ([]*models.IP, error)
- func (s *Storage) GetDBSession() *mgo.Session
- func (s *Storage) GetOne(value string) (*models.IP, error)
- func (s *Storage) Update(ip *models.IP) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = util.NewConfig()
Config 全局配置文件
View Source
var GlobalMgoSession, _ = mgo.Dial(string(Config.Mongo.Addr))
GlobalMgoSession 全局连接Session
Functions ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage struct is used for storeing persistent data of alerts
func (*Storage) GetDBSession ¶
func (s *Storage) GetDBSession() *mgo.Session
GetDBSession returns a new connection from the pool
Click to show internal directories.
Click to hide internal directories.