|
@@ -3,10 +3,13 @@ package grs
|
|
|
import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
- "gopkg.in/jmcvetta/napping.v3"
|
|
|
"net"
|
|
|
"net/url"
|
|
|
"regexp"
|
|
|
+ "time"
|
|
|
+
|
|
|
+ "gopkg.in/jmcvetta/napping.v3"
|
|
|
+ "gopkg.in/mgo.v2/bson"
|
|
|
)
|
|
|
|
|
|
const (
|
|
@@ -14,18 +17,19 @@ const (
|
|
|
)
|
|
|
|
|
|
type GRS struct {
|
|
|
- // ID bson.ObjectId `bson:"_id"`
|
|
|
- Source string `bson:"source" json:"source"`
|
|
|
- IpFrom string `bson:"ip_from" json:"ip_from"`
|
|
|
- IpTo string `bson:"ip_to" json:"ip_to"`
|
|
|
- IpFromRaw []byte `bson:"ip_from_raw" json:"ip_from_raw"`
|
|
|
- IpToRaw []byte `bson:"ip_to_raw" json:"ip_to_raw"`
|
|
|
- Description string `bson:"description" json:"description"`
|
|
|
- Country string `bson:"country" json:"country"`
|
|
|
- Status string `bson:"status" json:"status"`
|
|
|
- Cidr string `bson:"cidr" json:"cidr"`
|
|
|
- Name string `bson:"name" json:"name"`
|
|
|
- Org string `bson:"org" json:"org"`
|
|
|
+ ID bson.ObjectId `bson:"_id,omitempty" json:"id"`
|
|
|
+ Source string `bson:"source" json:"source"`
|
|
|
+ IpFrom string `bson:"ip_from" json:"ip_from"`
|
|
|
+ IpTo string `bson:"ip_to" json:"ip_to"`
|
|
|
+ IpFromRaw []byte `bson:"ip_from_raw" json:"ip_from_raw"`
|
|
|
+ IpToRaw []byte `bson:"ip_to_raw" json:"ip_to_raw"`
|
|
|
+ Description string `bson:"description" json:"description"`
|
|
|
+ Country string `bson:"country" json:"country"`
|
|
|
+ Status string `bson:"status" json:"status"`
|
|
|
+ Cidr string `bson:"cidr" json:"cidr"`
|
|
|
+ Name string `bson:"name" json:"name"`
|
|
|
+ Org string `bson:"org" json:"org"`
|
|
|
+ CreatedAt time.Time `bson:"created_at" json:"created_at"`
|
|
|
}
|
|
|
|
|
|
type GRSRaw struct {
|