Documentation
¶
Index ¶
- type DisplayEmail
- type Handlers
- type InfoContent
- type Service
- func (s *Service) DisplayEmail(ctx context.Context) (string, error)
- func (s *Service) Info(ctx context.Context) (string, error)
- func (s *Service) SetDisplayEmail(ctx context.Context, email string) (string, error)
- func (s *Service) SetInfo(ctx context.Context, html string) (string, error)
- func (s *Service) SetTeamEmailMode(ctx context.Context, mode TeamEmailMode) (TeamEmailMode, error)
- func (s *Service) TeamEmailMode(ctx context.Context) (TeamEmailMode, error)
- type Setting
- type Store
- func (s *Store) AddSetting(ctx context.Context, settingParam Setting) (Setting, error)
- func (s *Store) DeleteSetting(ctx context.Context, settingID string) error
- func (s *Store) EditSetting(ctx context.Context, settingParam Setting) (Setting, error)
- func (s *Store) GetSetting(ctx context.Context, settingID string) (Setting, error)
- func (s *Store) GetSettings(ctx context.Context) ([]Setting, error)
- func (s *Store) IncrementSetting(ctx context.Context, settingID string, delta int) (Setting, error)
- type TeamEmailMode
- type TeamEmailModeInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisplayEmail ¶
type DisplayEmail struct {
Email string `json:"email"`
}
DisplayEmail is the body of PUT /settings/display-email.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers serves /info and /settings.
func NewHandlers ¶
type InfoContent ¶
type InfoContent struct {
Content string `json:"content"`
}
InfoContent is the body of GET and PUT /info.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the editable site settings.
func NewService ¶
func NewService(store store) *Service
func (*Service) DisplayEmail ¶
DisplayEmail returns the public contact email ("" when not set).
func (*Service) SetDisplayEmail ¶
SetDisplayEmail validates and saves the public contact email; an empty email removes it.
func (*Service) SetInfo ¶
SetInfo sanitises and saves the info page HTML, returning what was stored.
func (*Service) SetTeamEmailMode ¶
func (s *Service) SetTeamEmailMode(ctx context.Context, mode TeamEmailMode) (TeamEmailMode, error)
SetTeamEmailMode saves which email team pages show.
func (*Service) TeamEmailMode ¶
func (s *Service) TeamEmailMode(ctx context.Context) (TeamEmailMode, error)
TeamEmailMode returns which email team pages show (ManagerEmails when never set).
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores the dependencies
func (*Store) AddSetting ¶
func (*Store) DeleteSetting ¶
func (*Store) EditSetting ¶
func (*Store) GetSetting ¶
type TeamEmailMode ¶
type TeamEmailMode string
TeamEmailMode says which email address team pages show for contacting a team. In TeamEmail and SiteEmail modes managers' personal addresses are never shown; when the chosen address isn't set, no email is shown.
const ( // ManagerEmails shows each manager's own email (the default). ManagerEmails TeamEmailMode = "manager" // TeamEmail shows the team's own contact address. TeamEmail TeamEmailMode = "team" // SiteEmail shows the site-wide public contact email. SiteEmail TeamEmailMode = "site" )
type TeamEmailModeInput ¶
type TeamEmailModeInput struct {
// Mode is "manager" (each manager's own email), "team" (the team's
// contact address) or "site" (the site-wide contact email).
Mode TeamEmailMode `json:"mode"`
}
TeamEmailModeInput is the body of PUT /settings/team-email-mode.