Documentation
¶
Index ¶
- func MelGenerator(turns int) []int
- func RandomNumber(max int, zeroInclude bool) int
- func TicketNumber(numbers int) string
- type Participant
- type Raffle
- func (r *Raffle) AddParticipant(newParticipant RaffleParticipant) error
- func (r *Raffle) AddTicketToParticipant(ticketSelected string, isRandom bool, participant string) (bool, error)
- func (r *Raffle) DeleteParticipant(id string) error
- func (r *Raffle) DiscardTicket() (string, error)
- func (r *Raffle) Prepare()
- func (r *Raffle) PrintParticipants()
- func (r *Raffle) SelectWinner() error
- func (r *Raffle) ToString() string
- type RaffleParticipant
- type Tanda
- type TandaParticipant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MelGenerator ¶
func RandomNumber ¶
func TicketNumber ¶
Types ¶
type Participant ¶
type Raffle ¶
type Raffle struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id"` Name string `json:"name" bson:"name"` Prize string `json:"prize" bson:"prize"` MaxTickets int `json:"max_tickets" bson:"max_tickets"` Participants []RaffleParticipant `json:"participants,omitempty" bson:"participants"` FirstTaken bool `json:"first_taken" bson:"first_taken"` Turns int `json:"turns" bson:"turns"` Tickets []string `json:"tickets" bson:"tickets"` Log []string `json:"log,omitempty" bson:"log"` CreatedAt time.Time `json:"createdAt" bson:"created_at"` UpdatedAt time.Time `json:"updatedAt" bson:"updated_at"` Open bool `json:"open" bson:"open"` Winner RaffleParticipant `json:"winner,omitempty" bson:"winner"` TicketWinner string `json:"ticket_winner,omitempty" bson:"ticket_winner"` }
func (*Raffle) AddParticipant ¶
func (r *Raffle) AddParticipant(newParticipant RaffleParticipant) error
func (*Raffle) AddTicketToParticipant ¶
func (*Raffle) DeleteParticipant ¶
func (*Raffle) DiscardTicket ¶
func (*Raffle) PrintParticipants ¶
func (r *Raffle) PrintParticipants()
func (*Raffle) SelectWinner ¶
type RaffleParticipant ¶
type RaffleParticipant struct { Participant `json:"participants" bson:"participants"` Tickets []string `json:"tickets" bson:"tickets"` }
type Tanda ¶
type Tanda struct { ID primitive.ObjectID `json:"id,omitempty" bson:"_id"` Participants []TandaParticipant `json:"participants" bson:"participants"` Name string `json:"name" bson:"name"` NumbersTotal int `json:"numbers_total" bson:"numbers_total"` }
type TandaParticipant ¶
type TandaParticipant struct { Participant `json:"participants" bson:"participants"` Numbers []int `json:"numbers" bson:"numbers"` }
Click to show internal directories.
Click to hide internal directories.