Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMinimumBouts ¶
func DefaultMinimumBouts() int
DefaultMinimumBouts returns an int representing the minimum number of bouts in the current season in which a fencer must pariticipate in order to be considered "eligible" for the championships and count for seeding purposes.
func DefaultSeasonStartDateConfig ¶
DefaultSeasonStartDateConfig returns a time.Time representing a default start date for the current season based on the date August 1 in the most recent year in which that date has already occurred.
Types ¶
type Config ¶
type Config struct { Host string `json:"domain"` Port int `json:"port"` Env string `json:"env"` Pepper string `json:"pepper"` HMACKey string `json:"hmac_key"` Database PostgresConfig `json:"database"` Mailgun MailgunConfig `json:"mailgun"` SeasonStartDate time.Time `json:"season_start_date"` MinimumBouts int `json:"minimum_bouts"` }
Config defines the app configuration.
func LoadConfig ¶
LoadConfig returns a Config based on the configuration specified in the config.json file, or the DefaultConfig if no config.json does not exist.
type MailgunConfig ¶
type MailgunConfig struct { From string `json:"from"` APIKey string `json:"api_key"` Domain string `json:"domain"` }
func DefaultMailgunConfig ¶
func DefaultMailgunConfig() MailgunConfig
DefaultMailgunConfig returns a default mailgun config for use in development.
type PostgresConfig ¶
type PostgresConfig struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` Name string `json:"name"` }
PostgresConfig is used to configure postgres to connect to the database.
func DefaultPostgresConfig ¶
func DefaultPostgresConfig() PostgresConfig
DefaultPostgresConfig returns a default postgres config for use in development.
func (PostgresConfig) ConnectionInfo ¶
func (c PostgresConfig) ConnectionInfo() string
ConnectionInfo returns the postgres connection info for use to connect to the database.
func (PostgresConfig) Dialect ¶
func (c PostgresConfig) Dialect() string
Dialect returns the dialect of the database used.