Documentation ¶
Overview ¶
The MIT License (MIT)
Copyright (c) 2014 Greivin López ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Variables
- func CreateMongoPersistor()
- type Player
- func (player *Player) Collection() string
- func (player *Player) Create() (err error)
- func (player *Player) Delete(cache skue.MemoryCacher) (err error)
- func (player *Player) List() (results interface{}, err error)
- func (player *Player) Read(cache skue.MemoryCacher) (err error)
- func (player *Player) Update(cache skue.MemoryCacher) (err error)
- type Team
- func (team *Team) Collection() string
- func (team *Team) Create() (err error)
- func (team *Team) Delete(cache skue.MemoryCacher) (err error)
- func (team *Team) List() (results interface{}, err error)
- func (team *Team) Read(cache skue.MemoryCacher) (err error)
- func (team *Team) Update(cache skue.MemoryCacher) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( Address string // The address to reach the MongoDB server Username string // The username to connect with the MongoDB server Password string // The password of the MongoDB user Database string // The name of the database to store the models )
Functions ¶
func CreateMongoPersistor ¶
func CreateMongoPersistor()
Creates a MongoDB persistor to interact with the database
Types ¶
type Player ¶
type Player struct { Id bson.ObjectId `json:"Id" bson:"_id"` FirstName string LastName string Nationality string Age int Position string Height string Weight string Foot string }
----------------------------------------------------------------------------
PLAYER
---------------------------------------------------------------------------- Player represents a soccer player.
func NewPlayer ¶
NewPlayer creates a new empty Player object with the provided id. All the other fields will be empty at first.
func (*Player) Collection ¶
type Team ¶
type Team struct { TeamId string Name string CompleteName string Logo string Country string Founded int Website string Players []Player }
----------------------------------------------------------------------------
TEAM
---------------------------------------------------------------------------- Team represents a soccer team.
func NewTeam ¶
NewPlayer creates a new empty Player object with the provided id. All the other fields will be empty at first.