@@ -7,19 +7,19 @@ This is the main class that you will need to implement. It should inherit from
7
7
These functions are called by the Edgee runtime to get the HTTP request to make to the provider's API for each event type.
8
8
*/
9
9
public class DataCollectionImpl : IDataCollection {
10
- public static IDataCollection . EdgeeRequest Page ( IDataCollection . Event e , List < ( string , string ) > creds ) {
10
+ public static IDataCollection . EdgeeRequest Page ( IDataCollection . Event e , List < ( string , string ) > settings ) {
11
11
/*
12
- cred is a list of tuple, which contains each key and secret for the provider
12
+ settings is a list of tuple, which contains each key and secret for the provider
13
13
for example, if your component is set to use
14
14
[[components.data_collection]]
15
15
name = "my_component"
16
16
component = "outpout.wasm"
17
- credentials .test_project_id = "123456789"
18
- credentials .test_write_key = "abcdefg"
17
+ settings .test_project_id = "123456789"
18
+ settings .test_write_key = "abcdefg"
19
19
then
20
- foreach (var cred in creds )
20
+ foreach (var settings in settings )
21
21
{
22
- Console.WriteLine($"{cred .Item1}: {cred.Item2}");
22
+ Console.WriteLine($"{settings .Item1}: {cred.Item2}");
23
23
}
24
24
will print:
25
25
test_project_id: 123456789
@@ -32,27 +32,30 @@ public static IDataCollection.EdgeeRequest Page(IDataCollection.Event e, List<(s
32
32
( "Content-Type" , "application/json" )
33
33
} ;
34
34
string body = "{\" event\" : \" page\" }" ;
35
- return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , body ) ;
35
+ bool forward_client_headers = true ;
36
+ return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , forward_client_headers , body ) ;
36
37
}
37
- public static IDataCollection . EdgeeRequest Track ( IDataCollection . Event e , List < ( string , string ) > creds ) {
38
+ public static IDataCollection . EdgeeRequest Track ( IDataCollection . Event e , List < ( string , string ) > settings ) {
38
39
string url = "https://example.com/" ;
39
40
var headers = new List < ( string , string ) >
40
41
{
41
42
( "Authorization" , "Bearer exampleToken123" ) ,
42
43
( "Content-Type" , "application/json" )
43
44
} ;
44
45
string body = "{\" event\" : \" track\" }" ;
45
- return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , body ) ;
46
+ bool forward_client_headers = true ;
47
+ return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , forward_client_headers , body ) ;
46
48
}
47
- public static IDataCollection . EdgeeRequest User ( IDataCollection . Event e , List < ( string , string ) > creds ) {
49
+ public static IDataCollection . EdgeeRequest User ( IDataCollection . Event e , List < ( string , string ) > settings ) {
48
50
string url = "https://example.com/" ;
49
51
var headers = new List < ( string , string ) >
50
52
{
51
53
( "Authorization" , "Bearer exampleToken123" ) ,
52
54
( "Content-Type" , "application/json" )
53
55
} ;
54
56
string body = "{\" event\" : \" user\" }" ;
55
- return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , body ) ;
57
+ bool forward_client_headers = true ;
58
+ return new IDataCollection . EdgeeRequest ( IDataCollection . HttpMethod . POST , url , headers , forward_client_headers , body ) ;
56
59
}
57
60
}
58
61
0 commit comments