Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Consent feature #196

Open
wants to merge 2 commits into
base: v3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/analytics-go.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Context struct {
Timezone string `json:"timezone,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Traits Traits `json:"traits,omitempty"`
Consent Consent `json:"consent,omitempty"`

// This map is used to allow extensions to the context specifications that
// may not be documented or could be introduced in the future.
Expand All @@ -42,6 +43,15 @@ type AppInfo struct {
Namespace string `json:"namespace,omitempty"`
}

// This type provides the representation of the `context.consent` object as defined
// in https://segment.com/docs/spec/common/#context
type Consent struct {
CategoryPreferences CategoryPreferences `json:"categoryPreferences,omitempty"`
}

// The specifications can be found at https://segment.com/docs/spec/identify/#traits
type CategoryPreferences map[string]bool

// This type provides the representation of the `context.campaign` object as
// defined in https://segment.com/docs/spec/common/#context
type CampaignInfo struct {
Expand Down