Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unmaintained mgo dependency with community for #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions Gopkg.lock

This file was deleted.

26 changes: 0 additions & 26 deletions Gopkg.toml

This file was deleted.

4 changes: 2 additions & 2 deletions document_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strings"
"time"

"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)

// This is the base type each model needs for working with the ODM. Of course you can create your own base type but make sure
Expand Down
7 changes: 7 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module github.com/SwenChan/mongodm

require (
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
github.com/kr/pretty v0.1.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
9 changes: 9 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4 changes: 2 additions & 2 deletions model.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package mongodm

import (
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)

/*
Expand Down
8 changes: 4 additions & 4 deletions mongodm.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ import (
"strings"
"time"

mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
mgo "github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)

const REL_11 string = "11" // one-to-one relation
Expand Down Expand Up @@ -297,7 +297,7 @@ func (self *Connection) Open() (err error) {
}()

var info *mgo.DialInfo

if self.Config.DialInfo == info {
info = &mgo.DialInfo{
Addrs: self.Config.DatabaseHosts,
Expand All @@ -310,7 +310,7 @@ func (self *Connection) Open() (err error) {
} else {
info = self.Config.DialInfo
}

session, err := mgo.DialWithInfo(info)

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions mongodm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"testing"

mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
mgo "github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"reflect"

"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)

/*
Expand Down