Documentation ¶
Index ¶
- type SettingRepository
- func (setting *SettingRepository) Details(ctx context.Context) (*model.SiteSettings, error)
- func (setting *SettingRepository) Exists(ctx context.Context) (bool, error)
- func (setting *SettingRepository) SaveSettings(ctx context.Context, input model.UpdateSiteSettingsInput) (*model.SiteSettings, error)
- func (setting *SettingRepository) UpdateFacebookCardSettings(ctx context.Context, input model.UpdateFacebookCardSettingsInput) (*model.SiteSettings, error)
- func (setting *SettingRepository) UpdateSEOSettings(ctx context.Context, input model.UpdateSEOSettingsInput) (*model.SiteSettings, error)
- func (setting *SettingRepository) UpdateTwitterCardSettings(ctx context.Context, input model.UpdateTwitterCardSettingsInput) (*model.SiteSettings, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SettingRepository ¶
func NewSettingRepository ¶
func NewSettingRepository(dbClient *mongo.Client) *SettingRepository
func (*SettingRepository) Details ¶
func (setting *SettingRepository) Details(ctx context.Context) (*model.SiteSettings, error)
Details fetch the settings of the current settings from the database, returns nil if none is found.
func (*SettingRepository) Exists ¶
func (setting *SettingRepository) Exists(ctx context.Context) (bool, error)
Exists checks whether settings have been set in the database
func (*SettingRepository) SaveSettings ¶
func (setting *SettingRepository) SaveSettings(ctx context.Context, input model.UpdateSiteSettingsInput) (*model.SiteSettings, error)
SaveSettings saves the settings to the database. If the settings already, it updates existing settings, otherwise it creates a new settings. Also, it ensures only a single record will exist in the database.
func (*SettingRepository) UpdateFacebookCardSettings ¶
func (setting *SettingRepository) UpdateFacebookCardSettings(ctx context.Context, input model.UpdateFacebookCardSettingsInput) (*model.SiteSettings, error)
UpdateFacebookCardSettings updates the facebook Open Graph card settings
func (*SettingRepository) UpdateSEOSettings ¶
func (setting *SettingRepository) UpdateSEOSettings(ctx context.Context, input model.UpdateSEOSettingsInput) (*model.SiteSettings, error)
UpdateSEOSettings updates the SEO settings for site
func (*SettingRepository) UpdateTwitterCardSettings ¶
func (setting *SettingRepository) UpdateTwitterCardSettings(ctx context.Context, input model.UpdateTwitterCardSettingsInput) (*model.SiteSettings, error)
UpdateTwitterCardSettings updates the twitter card settings
Click to show internal directories.
Click to hide internal directories.