Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Data ¶
type Data struct { API struct { BaseURL string PathPrefix string Bind string SwaggerAPIPath string SwaggerPath string SwaggerFilePath string } Connections struct { Email EmailConfig PostgreSQLConnection PostgreSQLConnection Logging struct { IrcHost string IrcChannel string IrcImpChannel string } } Web struct { BaseURL string } App struct { CryptPepper string Proposals struct { StartMonth uint TotalRuntimeMonths uint TotalGrantValue uint GrantIntervalMonths uint MaxGrantValue uint MaxLargeGrantsPerMonth uint SmallGrantValueThreshold uint SmallGrantVetoThreshold uint SmallGrantVoteThreshold uint SmallGrantVoteRuntimeDays uint } Templates Templates } }
Data holds all of polly's app settings
var ( // Settings contains the parsed configuration values Settings *Data )
type EmailConfig ¶
type EmailConfig struct { AdminEmail string ReplyTo string Mailman struct { Name string Address string BounceAddress string } SMTP struct { User string Password string Server string Port int } IMAP struct { User string Password string Server string Port int } }
EmailConfig contains all email settings
type EmailTemplate ¶
EmailTemplate holds all values of one email template
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a clever config parser
func NewHandler ¶
func NewHandler(fileName string, unmarshalStruct interface{}, notificationChannel chan interface{}) *Handler
NewHandler returns a new config handler
func (*Handler) CurrentData ¶
func (ch *Handler) CurrentData() interface{}
CurrentData returns the current config data
func (*Handler) LastReadValid ¶
LastReadValid returns whether the last parse succeeded
func (*Handler) SetRescanInterval ¶
SetRescanInterval controls how often the config should be rescanned
type PostgreSQLConnection ¶
type PostgreSQLConnection struct { User string Password string Host string DbName string SslMode string }
PostgreSQLConnection contains all of the db configuration values
func (*PostgreSQLConnection) Marshal ¶
func (c *PostgreSQLConnection) Marshal() string
Marshal returns a "Connection String" with escaped values of all non-empty fields as described at http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING
type Templates ¶
type Templates struct { Invitation EmailTemplate ModerationProposal EmailTemplate ProposalAccepted EmailTemplate ProposalStarted EmailTemplate }
Templates holds all email templates