signoz/pkg/query-service/model/userPreferences.go
Ankit Nayan be5d1f0090
feat: adding disable and anonymous functionality to telemetry collected (#637)
* chore: changed lib

* chore: changed lib

* chore: changed lib

* chore: changed lib

* chore: changes in params

* chore: changes in params

* chore: moving telemetry to a separate package

* feat: enabling telemetry via env var

* chore: removing posthog api_key

* feat: send heartbeat every 6hr

* feat: enabled version in application

* feat: added getter and setter apis and struct for user preferences

* feat: added version to properties to event

* feat: added apis to set and get user preferences and get version

* chore: refactored get and set userPreferences apis to dao pattern

* chore: added checks for telemetry enabled and anonymous during initialization

* chore: changed anonymous user functionality

* chore: sanitization

* chore: added uuid for userPreferences to send when user is anonymous
2022-01-26 21:40:44 +05:30

28 lines
755 B
Go

package model
type UserPreferences struct {
Id int `json:"id" db:"id"`
Uuid string `json:"uuid" db:"uuid"`
IsAnonymous bool `json:"isAnonymous" db:"isAnonymous"`
HasOptedUpdates bool `json:"hasOptedUpdates" db:"hasOptedUpdates"`
}
func (up *UserPreferences) SetIsAnonymous(isAnonymous bool) {
up.IsAnonymous = isAnonymous
}
func (up *UserPreferences) SetHasOptedUpdate(hasOptedUpdates bool) {
up.HasOptedUpdates = hasOptedUpdates
}
func (up *UserPreferences) GetIsAnonymous() bool {
return up.IsAnonymous
}
func (up *UserPreferences) GetHasOptedUpdate() bool {
return up.HasOptedUpdates
}
func (up *UserPreferences) GetId() int {
return up.Id
}
func (up *UserPreferences) GetUUID() string {
return up.Uuid
}