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 FindAll(collection *mgo.Collection, query interface{}, consignments *[]*Consignment) error
- func Insert(collection *mgo.Collection, consignment *Consignment) error
- type Consignment
- type Container
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 ¶
func FindAll ¶
func FindAll(collection *mgo.Collection, query interface{}, consignments *[]*Consignment) error
func Insert ¶
func Insert(collection *mgo.Collection, consignment *Consignment) error
Types ¶
type Consignment ¶
type Consignment struct { Id bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"` Description string `json:"description,omitempty" bson:"description,omitempty"` Weight int32 `json:"weight,omitempty" bson:"weight,omitempty"` Containers []*Container `json:"containers,omitempty" bson:"containers,omitempty"` VesselId string `json:"vessel_id,omitempty" bson:"vessel_id,omitempty"` }
Click to show internal directories.
Click to hide internal directories.