Documentation ¶
Index ¶
- Constants
- func Colorize(color string, msg string) string
- func FormatDate(t time.Time) string
- func FormatDateTime(t time.Time) string
- func PrintLogo()
- func StringToMonth(s string) (time.Month, error)
- type ByTotal
- type CurrencyAmounts
- type Donor
- type DonorConfig
- type Donors
- type MonthlySummaries
- func (ms MonthlySummaries) ByMonth(cb func(time.Month, *Summary))
- func (ms MonthlySummaries) ForMonth(month time.Month) *Summary
- func (ms MonthlySummaries) LatestMonth() time.Month
- func (ms MonthlySummaries) MarshalJSON() ([]byte, error)
- func (ms MonthlySummaries) Save(prefix string) error
- func (ms MonthlySummaries) Total() *Summary
- func (ms MonthlySummaries) UnmarshalJSON(data []byte) error
- type Summary
Constants ¶
View Source
const ( // Terminal color codes used to print things in color Red = "31" Green = "32" Yellow = "33" Blue = "34" BrightYellow = "33;1" )
View Source
const DonorConfigFile = "donors.json"
Variables ¶
This section is empty.
Functions ¶
func FormatDate ¶
func FormatDateTime ¶
Types ¶
type CurrencyAmounts ¶
Use a map because of multiple currencies
func (CurrencyAmounts) Add ¶
func (ca1 CurrencyAmounts) Add(ca2 CurrencyAmounts) CurrencyAmounts
func (CurrencyAmounts) GrandTotal ¶
func (ca CurrencyAmounts) GrandTotal(eurToUsdRate float32) float32
func (CurrencyAmounts) String ¶
func (ca CurrencyAmounts) String() string
type Donor ¶
type Donor struct { Name string Email string Total CurrencyAmounts Count int Anonymous bool }
type DonorConfig ¶
type DonorConfig struct { Anonymous []string `json:"anonymous,omitempty"` EmailToCorrectName map[string]string `json:"names,omitempty"` // contains filtered or unexported fields }
func LoadDonorConfig ¶
func LoadDonorConfig() (*DonorConfig, error)
func (*DonorConfig) Handle ¶
func (d *DonorConfig) Handle(p *Donor)
type MonthlySummaries ¶
func LoadSummaries ¶
func LoadSummaries(prefix string) (MonthlySummaries, error)
TODO: Not needed now?
func (MonthlySummaries) LatestMonth ¶
func (ms MonthlySummaries) LatestMonth() time.Month
func (MonthlySummaries) MarshalJSON ¶
func (ms MonthlySummaries) MarshalJSON() ([]byte, error)
func (MonthlySummaries) Save ¶
func (ms MonthlySummaries) Save(prefix string) error
func (MonthlySummaries) Total ¶
func (ms MonthlySummaries) Total() *Summary
func (MonthlySummaries) UnmarshalJSON ¶
func (ms MonthlySummaries) UnmarshalJSON(data []byte) error
type Summary ¶
type Summary struct { OneTimeAmt CurrencyAmounts OneTimeCount int SubscriptionAmt CurrencyAmounts SubscriptionCount int FeeAmt CurrencyAmounts }
func NewSummary ¶
func NewSummary() *Summary
func (*Summary) AddOneTime ¶
func (*Summary) AddSubscription ¶
func (*Summary) GrossTotal ¶
func (s *Summary) GrossTotal() CurrencyAmounts
func (*Summary) NetTotal ¶
func (s *Summary) NetTotal() CurrencyAmounts
Click to show internal directories.
Click to hide internal directories.