forked from ooni/probe-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
session_generated.go
106 lines (94 loc) · 3.28 KB
/
session_generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Code generated by go generate; DO NOT EDIT.
package engine
import "github.com/ooni/probe-engine/model"
//go:generate go run generate_session.go
// MaybeProbeIP is like ProbeIP except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultProbeIP.
func (s *Session) MaybeProbeIP() string {
out := model.DefaultProbeIP
if s.privacySettings.IncludeIP {
out = s.ProbeIP()
}
return out
}
// MaybeProbeASN is like ProbeASN except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultProbeASN.
func (s *Session) MaybeProbeASN() uint {
out := model.DefaultProbeASN
if s.privacySettings.IncludeASN {
out = s.ProbeASN()
}
return out
}
// MaybeProbeASNString is like ProbeASNString except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultProbeASNString.
func (s *Session) MaybeProbeASNString() string {
out := model.DefaultProbeASNString
if s.privacySettings.IncludeASN {
out = s.ProbeASNString()
}
return out
}
// MaybeProbeCC is like ProbeCC except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultProbeCC.
func (s *Session) MaybeProbeCC() string {
out := model.DefaultProbeCC
if s.privacySettings.IncludeCountry {
out = s.ProbeCC()
}
return out
}
// MaybeProbeNetworkName is like ProbeNetworkName except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultProbeNetworkName.
func (s *Session) MaybeProbeNetworkName() string {
out := model.DefaultProbeNetworkName
if s.privacySettings.IncludeASN {
out = s.ProbeNetworkName()
}
return out
}
// MaybeResolverIP is like ResolverIP except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultResolverIP.
func (s *Session) MaybeResolverIP() string {
out := model.DefaultResolverIP
if s.privacySettings.IncludeIP {
out = s.ResolverIP()
}
return out
}
// MaybeResolverASN is like ResolverASN except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultResolverASN.
func (s *Session) MaybeResolverASN() uint {
out := model.DefaultResolverASN
if s.privacySettings.IncludeASN {
out = s.ResolverASN()
}
return out
}
// MaybeResolverASNString is like ResolverASNString except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultResolverASNString.
func (s *Session) MaybeResolverASNString() string {
out := model.DefaultResolverASNString
if s.privacySettings.IncludeASN {
out = s.ResolverASNString()
}
return out
}
// MaybeResolverNetworkName is like ResolverNetworkName except that we return the real
// value only if the privacy settings allows us. Otherwise, we just
// return the default value, model.DefaultResolverNetworkName.
func (s *Session) MaybeResolverNetworkName() string {
out := model.DefaultResolverNetworkName
if s.privacySettings.IncludeASN {
out = s.ResolverNetworkName()
}
return out
}