Documentation ¶
Index ¶
- Constants
- func CreateSession(host string, port int32) (*mgo.Session, error)
- func CreateSessionWithAuth(host string, port int32, user, password, adminDBName string) (*mgo.Session, error)
- func Find(collection *mgo.Collection, query interface{}, vessel *Vessel) error
- func FindAll(collection *mgo.Collection, query interface{}, vessels *[]*Vessel) error
- func Insert(collection *mgo.Collection, vessel *Vessel) error
- type Vessel
Constants ¶
View Source
const (
DEFAULT_HOST = "127.0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
func CreateSession ¶
CreateSession create the session of mongo
func CreateSessionWithAuth ¶
Types ¶
type Vessel ¶
type Vessel struct { Id bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Capacity int32 `json:"capacity,omitempty" bson:"capacity,omitempty"` MaxWeight int32 `json:"max_weight,omitempty" bson:"max_weight,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty"` Available bool `json:"available,omitempty" bson:"available,omitempty"` OwerId string `json:"ower_id,omitempty" bson:"ower_id,omitempty"` }
Click to show internal directories.
Click to hide internal directories.