Documentation ¶
Index ¶
- Constants
- func CreateABCampaignMock(campaignID string, vgID string, targetings *targeting.Targeting, ...) *common.Campaign
- func CreateAllUsersTargetingMock() *targeting.Targeting
- func CreateMockDecisionContext() *connectors.DecisionContext
- func CreateModification(key string, value interface{}, modifType decision_response.ModificationsType) *decision_response.Modifications
- func CreateTargetingWithProvider() *targeting.Targeting
- func GetDecisionRequest(r *http.Request) (*decision_request.DecisionRequest, error)
- func NewTracker() *common.Tracker
- func SetUDCUrl(url string)
- func WriteClientError(w http.ResponseWriter, status int, message string)
- func WriteJSONOk(w http.ResponseWriter, data interface{})
- func WriteJSONStringOk(w http.ResponseWriter, data string)
- func WriteNoContent(w http.ResponseWriter)
- func WritePanicResponse(w http.ResponseWriter, visitorID *wrapperspb.StringValue)
- func WriteServerError(w http.ResponseWriter, err error)
- type ClientErrorMessage
- type UDCVisitorRow
Constants ¶
const UDC_TIMEOUT = 1000
Variables ¶
This section is empty.
Functions ¶
func CreateABCampaignMock ¶
func CreateABCampaignMock(campaignID string, vgID string, targetings *targeting.Targeting, modifications *decision_response.Modifications) *common.Campaign
CreateABCampaignMock returns a mocked AB Test campaign
func CreateAllUsersTargetingMock ¶
CreateAllUsersTargetingMock creates a mock targeting all users as byte
func CreateMockDecisionContext ¶
func CreateMockDecisionContext() *connectors.DecisionContext
func CreateModification ¶
func CreateModification(key string, value interface{}, modifType decision_response.ModificationsType) *decision_response.Modifications
CreateModification returns a single modification with key value string as byte array
func CreateTargetingWithProvider ¶
CreateTargetingWithProvider creates a mock targeting with an integration provider
func GetDecisionRequest ¶
func GetDecisionRequest(r *http.Request) (*decision_request.DecisionRequest, error)
GetDecisionRequest transforms http request into a DecisionRequest
func WriteClientError ¶
func WriteClientError(w http.ResponseWriter, status int, message string)
WriteClientError similarly add a helper for send responses relating to client errors.
func WriteJSONOk ¶
func WriteJSONOk(w http.ResponseWriter, data interface{})
WriteJSONOk similarly add a helper to send json responses with status OK.
func WriteJSONStringOk ¶
func WriteJSONStringOk(w http.ResponseWriter, data string)
WriteJSONStringOk similarly add a helper to send json stringified responses with status OK.
func WriteNoContent ¶
func WriteNoContent(w http.ResponseWriter)
WriteNoContent similarly add a helper to send 204 responses .
func WritePanicResponse ¶
func WritePanicResponse(w http.ResponseWriter, visitorID *wrapperspb.StringValue)
WritePanicResponse writes a response for panic mode
func WriteServerError ¶
func WriteServerError(w http.ResponseWriter, err error)
WriteServerError returns a 500 Internal Server Error response
Types ¶
type ClientErrorMessage ¶
type ClientErrorMessage struct {
Message string `json:"message"`
}
ClientErrorMessage represents a bad request response
type UDCVisitorRow ¶
type UDCVisitorRow struct { Segment string `json:"segment"` Value string `json:"value"` Partner string `json:"partner"` }
func FetchVisitorData ¶
func FetchVisitorData(environmentID string, visitorID string) ([]UDCVisitorRow, error)