Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) GetAll ¶
GetAll returns the latest version of each setting key.
Returns:
- []Settings: A slice of settings with the latest version for each key
- error: Database error if the query fails
func (*Service) GetVersionHistory ¶
func (s *Service) GetVersionHistory(key SettingsKey, limit int) ([]Settings, error)
GetVersionHistory returns the last N versions of a setting key, ordered by version descending.
Parameters:
- key: The settings key to get history for
- limit: Maximum number of versions to return
Returns:
- []Settings: A slice of settings versions, newest first
- error: Database error if the query fails
type Settings ¶
type Settings struct {
ID int64 `gorm:"primaryKey;autoIncrement" json:"id"`
Key SettingsKey `json:"key"`
Value string `json:"value"`
Version int `json:"version"`
CreatedAt int64 `json:"created_at"`
}
type SettingsKey ¶
type SettingsKey string
const (
SettingsKeyCustomRules SettingsKey = "custom_rules"
)
Click to show internal directories.
Click to hide internal directories.