File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 99 "gopkg.in/mgo.v2/bson"
1010)
1111
12- // Options :
12+ // Options : MongoDB connection information for oplog tailing
1313type Options struct {
1414 Addrs []string
1515 Username string
@@ -20,13 +20,7 @@ type Options struct {
2020 Events []string
2121}
2222
23- // LogC :
24- type LogC chan * []Log
25-
26- // ErrC :
27- type ErrC chan error
28-
29- // Log :
23+ // Log : Oplog document
3024type Log struct {
3125 Timestamp time.Time `json:"wall" bson:"wall"`
3226 HistoryID int64 `json:"h" bson:"h"`
@@ -37,7 +31,7 @@ type Log struct {
3731 Update map [string ]interface {} `json:"o2" bson:"o2"`
3832}
3933
40- // MgoConn :
34+ // MgoConn : MongoDB connect
4135func (o * Options ) MgoConn (e chan error ) (* mgo.Session , * mgo.Collection ) {
4236 var mgoSess * mgo.Session
4337 var mgoColl * mgo.Collection
@@ -66,7 +60,7 @@ func (o *Options) MgoConn(e chan error) (*mgo.Session, *mgo.Collection) {
6660 return mgoSess , mgoColl
6761}
6862
69- // Tail :
63+ // Tail : MongoDB oplog tailing start
7064func (o * Options ) Tail (l chan * []Log , e chan error ) {
7165 bsonInsert := bson.M {}
7266 bsonUpdate := bson.M {}
You can’t perform that action at this time.
0 commit comments