Documentation ¶
Index ¶
- func GetCollection(req *http.Request) (string, error)
- func GetIDToken(req *http.Request) (string, error)
- func GetLang(req *http.Request) (string, error)
- func GetRefreshToken(req *http.Request) (string, error)
- func GetUserAuthToken(req *http.Request) (string, error)
- func SetABTest(w http.ResponseWriter, servs ABServices, domain string) error
- func SetCollection(w http.ResponseWriter, value, domain string)
- func SetIDToken(w http.ResponseWriter, idToken, domain string)
- func SetLang(w http.ResponseWriter, lang, domain string)
- func SetPolicy(w http.ResponseWriter, policy Policy, domain string)
- func SetPreferenceIsSet(w http.ResponseWriter, domain string)
- func SetRefreshToken(w http.ResponseWriter, refreshToken, domain string)
- func SetUserAuthToken(w http.ResponseWriter, userAuthToken, domain string)
- func UpdateNewSearch(req *http.Request, w http.ResponseWriter, newValue time.Time, domain string) error
- func UpdateOldSearch(req *http.Request, w http.ResponseWriter, newValue time.Time, domain string) error
- type ABServices
- type Policy
- type PreferencesResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCollection ¶
GetCollection reads collection_id cookie and returns it's value
func GetIDToken ¶ added in v0.2.0
GetIDToken reads id_token cookie and returns it's value
func GetRefreshToken ¶ added in v0.2.0
GetRefreshToken reads refresh_token cookie and returns it's value
func GetUserAuthToken ¶
GetUserAuthToken reads access_token cookie and returns it's value
func SetABTest ¶ added in v0.3.0
func SetABTest(w http.ResponseWriter, servs ABServices, domain string) error
SetABTest sets a cookie containing collection ID
func SetCollection ¶
func SetCollection(w http.ResponseWriter, value, domain string)
SetCollection sets a cookie containing collection ID
func SetIDToken ¶ added in v0.2.0
func SetIDToken(w http.ResponseWriter, idToken, domain string)
SetIDToken sets a cookie containing users id token ("id_token")
func SetLang ¶
func SetLang(w http.ResponseWriter, lang, domain string)
SetLang sets a cookie containing locale code
func SetPolicy ¶
func SetPolicy(w http.ResponseWriter, policy Policy, domain string)
SetPolicy sets a cookie with the users preferences, or sets default preferences on error
func SetPreferenceIsSet ¶
func SetPreferenceIsSet(w http.ResponseWriter, domain string)
SetPreferenceIsSet sets a cookie to record a user has set cookie preferences
func SetRefreshToken ¶ added in v0.2.0
func SetRefreshToken(w http.ResponseWriter, refreshToken, domain string)
SetRefreshToken sets a cookie containing users refresh token ("refresh_token")
func SetUserAuthToken ¶
func SetUserAuthToken(w http.ResponseWriter, userAuthToken, domain string)
SetUserAuthToken sets a cookie containing users auth token ("access token")
func UpdateNewSearch ¶ added in v0.3.0
func UpdateNewSearch(req *http.Request, w http.ResponseWriter, newValue time.Time, domain string) error
UpdateNewSearch updates new search value in A/B test cookie
func UpdateOldSearch ¶ added in v0.3.0
func UpdateOldSearch(req *http.Request, w http.ResponseWriter, newValue time.Time, domain string) error
UpdateOldSearch updates old search value in A/B test cookie
Types ¶
type ABServices ¶ added in v0.3.0
type ABServices struct { NewSearch *time.Time `json:"new_search,omitempty"` OldSearch *time.Time `json:"old_search,omitempty"` }
ABServices contains all services in A/B test and their expiry date
type PreferencesResponse ¶
PreferencesResponse is a combination of cookie policy and whether they have be set by user
func GetCookiePreferences ¶
func GetCookiePreferences(req *http.Request) PreferencesResponse
GetCookiePreferences returns a struct with all cookie preferences