Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.5.0
type Config struct { Mode Mode `mapstructure:"mode" yaml:"mode"` Url string `mapstructure:"url" yaml:"url"` Port string `mapstructure:"port" yaml:"port"` TimeZone string `mapstructure:"time_zone" yaml:"time_zone"` CookieSecret string `mapstructure:"cookie_secret" yaml:"cookie_secret"` GoogleAuth GoogleAuthConfig `mapstructure:"google_auth" yaml:"google_auth"` Sendgrid SendgridConfig `yaml:"sendgrid" mapstructure:"sendgrid"` SMTP SMTPConfig `yaml:"smtp" mapstructure:"smtp"` DatabaseConfig `yaml:"db" mapstructure:"db"` }
func (Config) EmailService ¶ added in v0.5.0
type DataAccess ¶ added in v0.5.0
type DataAccess struct { ProblemStore problems.Store MailService email.Service PartialsStore templates.Store Categories njudge.Categories Tags njudge.Tags Problems njudge.Problems Users njudge.Users Submissions njudge.Submissions SolvedStatusQuery njudge.SolvedStatusQuery ProblemInfoQuery njudge.ProblemInfoQuery ProblemQuery njudge.ProblemQuery ProblemListQuery njudge.ProblemListQuery SubmissionListQuery njudge.SubmissionListQuery Problemsets njudge.Problemsets SubmitService *njudge.SubmitService TagsService njudge.TagsService TaskArchiveService njudge.TaskArchiveService ProblemsetRanklistService njudge.ProblemsetRanklistService }
DataAccess provides access to the business logic in handlers
func NewDBDataAccess ¶ added in v0.5.0
func NewDBDataAccess(ctx context.Context, ps problems.Store, DB *sql.DB, ms email.Service) (*DataAccess, error)
NewDBDataAccess creates a DataAccess backed by "database"-kind business logic (internal/njudge/db)
func NewDemoDataAccess ¶ added in v0.5.0
func NewDemoDataAccess(ctx context.Context, ps problems.Store, ms email.Service) (*DataAccess, error)
NewDemoDataAccess creates in-memory (internal/njudge/memory) "demo" data
type DatabaseConfig ¶ added in v0.5.0
type DatabaseConfig struct { User string `mapstructure:"user" yaml:"user"` Password string `mapstructure:"password" yaml:"password"` Host string `mapstructure:"host" yaml:"host"` Name string `mapstructure:"name" yaml:"name"` Port int `mapstructure:"port" yaml:"port"` SSLMode bool `mapstructure:"ssl_mode" yaml:"ssl_mode"` }
func (DatabaseConfig) ConnectAndPing ¶ added in v0.5.0
type GoogleAuthConfig ¶ added in v0.5.0
type SMTPConfig ¶ added in v0.5.0
type SMTPConfig struct { Enabled bool `yaml:"enabled" mapstructure:"enabled"` MailAccount string `yaml:"mail_account" mapstructure:"mail_account"` MailServerHost string `yaml:"mail_server" mapstructure:"mail_server"` MailServerPort int `yaml:"mail_port" mapstructure:"mail_port"` MailAccountPassword string `yaml:"mail_password" mapstructure:"mail_password"` }
type SendgridConfig ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.