Saif Farooqui
05/16/2024, 8:09 PMmessage Request {
string id = 1;
map<string, string> device_headers = 2;
map<string, string> params = 3;
repeated break_duration_ms = 4;
}
In my use case objects and arrays can be empty as well. I am not able to find some good resources/examples for the same in golang.
cc: @Praful PoudelMatt (pactflow.io / pact-js / pact-go)
Saif Farooqui
05/17/2024, 5:21 AMgrpcInteraction := `{
"pact:proto": "` + filepath.ToSlash(dir) + `",
"pact:proto-service": "Calculate/Rectangle",
"pact:content-type": "application/protobuf",
"pact:protobuf-config": {
"additionalIncludes": ["` + filepath.ToSlash(additionalDir) + `", "` + filepath.ToSlash(additionalDir2) + `"]
},
"request": {
"id": "matching(type, '1')",
"correlation_id": "matching(type, 'sdfsadghhhhhh')",
"params": {},
"protocol": "matching(type, 'dash')",
"request_ctx": {
"tenant_id": "matching(type, 'beam')",
"client_ip": "matching(semver, '198.147.1.9')",
"user_agent": "matching(type, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36')",
"pre_play_req_timestamp": "matching(datetime, 'yyyy-MM-ddTHH:mm:ss.sssssssssZ', '2024-03-18T16:24:16.977359576Z')",
"mode": "matching(type, 'MODE_XYZ')",
"asset_id": "matching(type,'')"
},
"playlist_duration": "Like('2564s')",
"timeout": "Like('4s')",
"timestamp": "Like('2024-03-18T16:24:17.003265Z')"
},
...
}`
but i am not sure how can i do the matching for something below object
"breaks": [
{
"id": "pre.1460231218",
"break_id": "2341234-86f4-4955-8275-db76531ce378.0",
"trackers": [
{
"event": "breakEnd",
"url": "<http://ggooel.com|ggooel.com>"
},
...
]
},
{
"id": "cue_point--1843487036",
"break_id": "cd1cefc0-86f4-4955-8275-db76531ce378.1",
"duration_ms": 90089,
"time_offset": 396000,
"break_index": 1,
"trackers": [
{
"event": "breakStart",
"url": "<https://yahoo.com>"
},
...
],
"test_details": [
{
"id": "314234-4360-11ee-971a-e6a552723314",
"duration_ms": 30030,
"creative_id": "48637382",
"manifest_creative_url": "c7d42618-3214-1432-a278-ac3d3a420054/0_32301f.mpd",
"xyz": {
"id": "3214324",
"title": "Placement 3",
"duration_ms": "30030",
"trackers": [
{
"event": "midpoint",
"url": "<http://test1.com|test1.com>"
},
...
],
"extensions": [
"[{\"type\":\"Test\",\"creativeParameters\":[{\"creativeId\":\"48123137382\",\"name\":\"test_reporting\",\"type\":\"Linear\",\"value\":\"advertiser_name:Test active advertiser;advertiser_id:1138148;1660676279606087178\"}]}]"
],
"xyz_verifications": "[]",
"creative_type": "CREATIVE_TYPE",
"xyz_metadata": {
"xyz_id": "65182639",
"xyz_system": "ERWLJ"
},
"xyzpaid": {},
"error": [
"<http://test4.com|test4.com>"
],
"xyz_ad_id": "413243242639.140527165835520"
},
"xyz_creative_id": "x/y/z.mp4",
"xyz_creative_uuid": "c7d42618-6558-512d-a278-ac3d3a420054",
"xyz_encode": {
"uri": "c7d42618-6558-512d-a278-ac3d3a420054/0_32301f.mpd",
"origin_id": "s1:avc-afs-media-us-east-1-dev"
}
},
...
]
}
],
as you will notice few of the keys is not present in further loop iterationMatt (pactflow.io / pact-js / pact-go)
Slackbot
05/17/2024, 6:35 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Saif Farooqui
05/17/2024, 6:56 AM