Documentation
¶
Index ¶
- func EmailInstructions(pairs []*Pair, tmpl *template.Template, subject, emailTestRecipient string, ...) error
- func GenerateParticipantsJSON(participants []*Participant) (string, error)
- func UpdateParticipantsJSON(participantsFilepath string, pairs []*Pair) error
- func WriteInstructions(pairs []*Pair, tmpl *template.Template, extension string) error
- type Instructions
- type Pair
- type Participant
- func GetParticipantsFromCSV(csvStr string, emailAddressColumn, platformsColumn int, ignoreColumns []int, ...) ([]*Participant, error)
- func GetParticipantsFromJSON(jsonStr string, skip bool) ([]*Participant, error)
- func MergeParticipants(participants, previousParticipants []*Participant) []*Participant
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmailInstructions ¶
func EmailInstructions(pairs []*Pair, tmpl *template.Template, subject, emailTestRecipient string, sender email.Sender) error
EmailInstructions emails the instructions to the participants based on provided email template
func GenerateParticipantsJSON ¶
func GenerateParticipantsJSON(participants []*Participant) (string, error)
GenerateParticipantsJSON generates readable JSON for the participants
func UpdateParticipantsJSON ¶
UpdateParticipantsJSON takes
Types ¶
type Instructions ¶
type Instructions struct {
GiverName string
ReceiverName string
ReceiverResponses []*Response
ReceiverPlatforms []string
}
Instructions contains the information necessary for generating exchange instructions Works with the instructions MD template
type Pair ¶
type Pair struct {
Giver *Participant
Receiver *Participant
}
Pair is a pair of participants
type Participant ¶
type Participant struct {
EmailAddress string // must be unique
Skip bool
LatestRecipients []string
Platforms []string
Responses []*Response
}
Participant represents a person who will give/receive in the exchange
func GetParticipantsFromCSV ¶
func GetParticipantsFromCSV(csvStr string, emailAddressColumn, platformsColumn int, ignoreColumns []int, platformsSeparator string) ([]*Participant, error)
GetParticipantsFromCSV transforms the CSV to a slice of Particpant
func GetParticipantsFromJSON ¶
func GetParticipantsFromJSON(jsonStr string, skip bool) ([]*Participant, error)
GetParticipantsFromJSON transforms the json to a slice of Particpant
func MergeParticipants ¶
func MergeParticipants(participants, previousParticipants []*Participant) []*Participant
MergeParticipants takes a set of participants and merges in previous participant data Previous participants who also exist in the participants slice have their pairing history included. Previous participants who don't exist in the participants slice are copied in with the pairing history and marked to be skipped.
func (*Participant) IsCompatible ¶
func (p *Participant) IsCompatible(otherParticipant *Participant) bool
IsCompatible returns true if the participants have at least one music platform in common