Documentation ¶
Index ¶
- Constants
- func BuildDBSession() (*mgo.Session, error)
- func CloseConnection(s *mgo.Session)
- func ConnectCollection(s *mgo.Session, db string, collection string) *mgo.Collection
- func CreateCampIndex() error
- func DeleteDNWTennisDB() error
- func DeleteRegistrationCollection() error
- func OpenCampCollection() (*mgo.Session, *mgo.Collection, error)
- func OpenRegistrationCollection() (*mgo.Session, *mgo.Collection, error)
- type ByTimeStamp
- type ByTypeAndAge
- type Camp
- type Camper
- type Registration
- type Request
- type Section
Constants ¶
View Source
const ( // MONGODBSERVER = "mongodb://dnwUser:dnw0001@ds051459.mongolab.com:51459/campmaster" // Database URL DATABASE = "campmaster" // Database name containing the app registration collection COL_CAMPS = "Camps" // Name of camp configuration collection COL_REG = "Registrations" // All camp registrations )
Variables ¶
This section is empty.
Functions ¶
func BuildDBSession ¶
func CloseConnection ¶
func ConnectCollection ¶
func CreateCampIndex ¶
func CreateCampIndex() error
CreateCampIndex - Is a setup function called to create the index set required on the camps collection
func DeleteDNWTennisDB ¶
func DeleteDNWTennisDB() error
func DeleteRegistrationCollection ¶
func DeleteRegistrationCollection() error
func OpenCampCollection ¶
func OpenCampCollection() (*mgo.Session, *mgo.Collection, error)
func OpenRegistrationCollection ¶
func OpenRegistrationCollection() (*mgo.Session, *mgo.Collection, error)
Types ¶
type ByTimeStamp ¶
type ByTimeStamp []Registration
func (ByTimeStamp) Len ¶
func (a ByTimeStamp) Len() int
func (ByTimeStamp) Less ¶
func (a ByTimeStamp) Less(i, j int) bool
func (ByTimeStamp) Swap ¶
func (a ByTimeStamp) Swap(i, j int)
type ByTypeAndAge ¶
type ByTypeAndAge []Camper
func (ByTypeAndAge) Len ¶
func (a ByTypeAndAge) Len() int
func (ByTypeAndAge) Less ¶
func (a ByTypeAndAge) Less(i, j int) bool
func (ByTypeAndAge) Swap ¶
func (a ByTypeAndAge) Swap(i, j int)
type Camp ¶
type Camp struct { ID bson.ObjectId `bson:"_id,omitempty"` Cid int64 "Cid" // Defines a logical Camp Title string "Title" // Generic name for camp Active bool "Active" // Flips to no when camp is past signup dates Cost int64 "Cost" // Base cost of camp - Applies to all sections RegStart string "RegStart" // DateTime signup can begin RegEnd string "RegEnd" // DateTime signup can end RefundDeadline string "RefundDeadline" // Last date to cancel and get a refund BillingDate string "BillingDate" // Date on which charge will be billed -- 1st time use in 2015 CampOver string "CampOver" // Date after which the site should no longer allow registrations and flip to a see you next year page CamperTypes []string "CamperTypes" // Classes of campers - For DNW - Homeowner / Guest Sections []Section "Sections" // Array of sections for this camp }
func GetActiveCamp ¶
func ListCurrentCamp ¶
ListCurrentCamp - returns only the current camp
func (*Camp) AddSection ¶
AddSection adds a new camp section to this camp
type Camper ¶
type Camper struct { Name string "camperName" Age string "camperAge" ShirtSize string "camperShirtSize" // Other items can be added // Could do this as a uniform where we having clothing and collect sizes // What to show would be part of camp setup Type string "camperType" // Defines which class of camper this person is - Options defined in Camp TimeStamp string "timeStamp" // Date and time this camper was entered Comment string "comment" // Comment field for each camper Sections []bson.ObjectId "camperSections" // IDs of sections this camper is assigned to WaitList []bson.ObjectId "camperWaitListed" // IDs of sections this camper is wait listed for }
type Registration ¶
type Registration struct { RegId bson.ObjectId `bson:"_id,omitempty"` // ID of this registration RegCampId bson.ObjectId "campId" // ID of the camp this registration is connected to RegName string "regName" // Name for this registration RegPhone string "regPhone" // Contact phone for this registration RegSite string "regSite" // Home Site or other identifier for billing RegEmail string "regEmail" // Contact email for this registration RegTimeStamp string "regTimeStamp" // Date and time this entry was submitted RegComments string "RegComments" // Comment field RegRequests []Request "regRequests" // List of camp section ids and priority RegCampers []Camper "regCampers" // List of campers registered }
func ListRegistrations ¶
func ListRegistrations() ([]Registration, error)
func ListReservationsForCamp ¶
func ListReservationsForCamp(campID bson.ObjectId) ([]Registration, error)
func NewRegistration ¶
func NewRegistration() Registration
NewRegstration creates a new registration structure.
func (Registration) AddCamper ¶
func (r Registration) AddCamper(c Camper) Registration
func (Registration) Save ¶
func (r Registration) Save() error
type Request ¶
type Section ¶
type Section struct { ID bson.ObjectId `bson:"Id"` // ID of this section Name string "Name" // Friendly name for this section Start string "Start" // DateTime camp section starts End string "End" // DateTime camp section ends CostDifferential int64 "CostDifferential" // Discount or premium paid for this section }
func NewCampSection ¶
func NewCampSection() *Section
Click to show internal directories.
Click to hide internal directories.