Skip to content

Commit 806fdc3

Browse files
authored
Add comments to function and struct
1 parent 984171e commit 806fdc3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

oplog.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"gopkg.in/mgo.v2/bson"
1010
)
1111

12-
// Options :
12+
// Options : MongoDB connection information for oplog tailing
1313
type 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
3024
type 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
4135
func (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
7064
func (o *Options) Tail(l chan *[]Log, e chan error) {
7165
bsonInsert := bson.M{}
7266
bsonUpdate := bson.M{}

0 commit comments

Comments
 (0)