-
Notifications
You must be signed in to change notification settings - Fork 19
/
url_matcher.go
55 lines (47 loc) · 1.29 KB
/
url_matcher.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
package wiremock
// URLMatcherInterface is pair URLMatchingStrategy and string matched value
type URLMatcherInterface interface {
Strategy() URLMatchingStrategy
Value() string
}
// URLMatcher is structure for defining the type of url matching.
type URLMatcher struct {
strategy URLMatchingStrategy
value string
}
// Strategy returns URLMatchingStrategy of URLMatcher.
func (m URLMatcher) Strategy() URLMatchingStrategy {
return m.strategy
}
// Value returns value of URLMatcher.
func (m URLMatcher) Value() string {
return m.value
}
// URLEqualTo returns URLMatcher with URLEqualToRule matching strategy.
func URLEqualTo(url string) URLMatcher {
return URLMatcher{
strategy: URLEqualToRule,
value: url,
}
}
// URLPathEqualTo returns URLMatcher with URLPathEqualToRule matching strategy.
func URLPathEqualTo(url string) URLMatcher {
return URLMatcher{
strategy: URLPathEqualToRule,
value: url,
}
}
// URLPathMatching returns URLMatcher with URLPathMatchingRule matching strategy.
func URLPathMatching(url string) URLMatcher {
return URLMatcher{
strategy: URLPathMatchingRule,
value: url,
}
}
// URLMatching returns URLMatcher with URLMatchingRule matching strategy.
func URLMatching(url string) URLMatcher {
return URLMatcher{
strategy: URLMatchingRule,
value: url,
}
}