Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/PhakornKiong/go-pattern-match
/ functions
Functions
117 in github.com/PhakornKiong/go-pattern-match
⨍
Functions
117
◇
Types & classes
33
↓ 116 callers
Method
Match
(any)
pattern/matcher.go:8
↓ 69 callers
Function
String
()
pattern/string.go:18
↓ 58 callers
Method
Otherwise
Otherwise is called if no patterns match
pattern/matcher.go:130
↓ 47 callers
Method
WithPattern
WithPattern check if pattern matches the entire input
pattern/matcher.go:36
↓ 42 callers
Function
Int
()
pattern/int.go:15
↓ 32 callers
Method
Contains
(value string)
pattern/string.go:57
↓ 19 callers
Method
EndsWith
(value string)
pattern/string.go:39
↓ 19 callers
Function
UnionPattern
(patterns ...V)
pattern/union.go:28
↓ 18 callers
Method
Gt
(min int)
pattern/int.go:31
↓ 17 callers
Function
Map
()
pattern/map.go:19
↓ 17 callers
Function
Union
(patterns ...V)
pattern/union.go:11
↓ 16 callers
Method
KeyVal
(key K, val V)
pattern/map.go:32
↓ 16 callers
Method
MinLength
(value int)
pattern/string.go:45
↓ 15 callers
Method
WithValues
WithValues check for deep equality between each of the value against the each of the input
pattern/matcher.go:72
↓ 14 callers
Function
IntersectionPattern
(patterns ...V)
pattern/intersection.go:28
↓ 13 callers
Function
Not
(pattern any)
pattern/not.go:9
↓ 13 callers
Function
Struct
()
pattern/struct.go:22
↓ 11 callers
Method
FieldPattern
(fieldName string, p Patterner)
pattern/struct.go:39
↓ 11 callers
Function
Intersection
(patterns ...V)
pattern/intersection.go:11
↓ 10 callers
Method
Val
(val V)
pattern/map.go:44
↓ 10 callers
Method
WithValue
WithValue check for deep equality between the value and the input
pattern/matcher.go:117
↓ 9 callers
Method
StartsWith
(value string)
pattern/string.go:33
↓ 9 callers
Method
WithPatterns
WithPatterns check each of the patterns against the each of the input
pattern/matcher.go:44
↓ 8 callers
Method
FieldValue
(fieldName string, v any)
pattern/struct.go:33
↓ 8 callers
Function
Patteners
(patterns ...Patterner)
pattern/matcher.go:11
↓ 7 callers
Method
Lt
(max int)
pattern/int.go:25
↓ 7 callers
Method
MaxLength
(value int)
pattern/string.go:51
↓ 7 callers
Method
Regex
(value *regexp.Regexp)
pattern/string.go:63
↓ 6 callers
Function
Any
()
pattern/any.go:6
↓ 6 callers
Method
Key
(key K)
pattern/map.go:38
↓ 6 callers
Method
KeyValPatterns
(key K, p Patterner)
pattern/map.go:50
↓ 6 callers
Method
clone
()
pattern/string.go:22
↓ 6 callers
Method
clone
()
pattern/slice.go:18
↓ 5 callers
Method
ContainsPattern
(p Patterner)
pattern/slice.go:59
↓ 5 callers
Function
match
(input string)
example/string/main.go:10
↓ 5 callers
Function
shippingStrategyFactory
(o Order)
example/shippingStrategy/main.go:27
↓ 5 callers
Function
shippingStrategyFactoryPattern
(o Order)
example/shippingStrategy/main.go:61
↓ 4 callers
Function
Fib
(input int)
example/fibonacci/main.go:9
↓ 4 callers
Function
FoodSorterWithPattern
(input string)
example/switchunion/main.go:22
↓ 4 callers
Method
Head
(v V)
pattern/slice.go:29
↓ 4 callers
Method
TailPattern
(p Patterner)
pattern/slice.go:47
↓ 4 callers
Method
clone
()
pattern/map.go:23
↓ 4 callers
Function
match
(input string)
example/withInput/main.go:9
↓ 4 callers
Method
patternMatched
(fn Handler[T])
pattern/matcher.go:137
↓ 3 callers
Method
Between
(min, max int)
pattern/int.go:19
↓ 3 callers
Method
Gte
(min int)
pattern/int.go:43
↓ 3 callers
Method
HeadPattern
(p Patterner)
pattern/slice.go:35
↓ 3 callers
Method
Lte
(max int)
pattern/int.go:37
↓ 3 callers
Method
Tail
(v V)
pattern/slice.go:41
↓ 3 callers
Function
match
(input []int)
example/slice/main.go:9
↓ 3 callers
Function
match
(input []int)
example/withvalues/main.go:9
↓ 2 callers
Method
Negative
()
pattern/int.go:55
↓ 2 callers
Function
NewAirStrategy
(distance, weight, volume int)
example/shippingStrategy/air.go:14
↓ 2 callers
Function
NewDefaultStrategy
()
example/shippingStrategy/default.go:10
↓ 2 callers
Function
NewFreightStrategy
(distance, weight, volume int)
example/shippingStrategy/freight.go:14
↓ 2 callers
Function
NewLocalStrategy
(distance, weight int)
example/shippingStrategy/local.go:13
↓ 2 callers
Function
NotPattern
(pattern V)
pattern/not.go:21
↓ 2 callers
Method
Positive
()
pattern/int.go:49
↓ 2 callers
Function
When
(predicate Predicate[V])
pattern/when.go:9
↓ 2 callers
Method
clone
()
pattern/struct.go:26
↓ 2 callers
Function
getFieldValue
(v reflect.Value, fieldName string)
pattern/struct.go:79
Method
CalculateCost
()
example/shippingStrategy/air.go:10
Method
CalculateCost
()
example/shippingStrategy/local.go:9
Method
CalculateCost
()
example/shippingStrategy/default.go:6
Method
CalculateCost
()
example/shippingStrategy/main.go:10
Method
CalculateCost
()
example/shippingStrategy/freight.go:10
Method
Contains
(v V)
pattern/slice.go:53
Function
FoodSorter
(input string)
example/switchunion/main.go:9
Method
Match
(value any)
pattern/not.go:13
Method
Match
(value any)
pattern/not.go:25
Method
Match
(value any)
pattern/int.go:61
Method
Match
(value any)
pattern/union.go:15
Method
Match
(value any)
pattern/union.go:32
Method
Match
(value any)
pattern/string.go:69
Method
Match
(value any)
pattern/map.go:56
Method
Match
(value any)
pattern/intersection.go:15
Method
Match
(value any)
pattern/intersection.go:32
Method
Match
(value any)
pattern/any.go:10
Method
Match
(value any)
pattern/struct.go:45
Method
Match
(value any)
pattern/when.go:13
Method
Match
(value any)
pattern/slice.go:65
Function
NewMatcher
NewMatcher is a function that creates a new Matcher instance. It takes a value of any type V and returns a pointer to a Matcher instance. The returned
pattern/matcher.go:31
Function
Slice
()
pattern/slice.go:14
Function
TestAnyPattern
(t *testing.T)
pattern/any_test.go:9
Function
TestInt
(t *testing.T)
pattern/int_test.go:9
Function
TestIntersection
(t *testing.T)
pattern/intersection_test.go:9
Function
TestIntersectionPattern
(t *testing.T)
pattern/intersection_test.go:31
Function
TestMap
(t *testing.T)
pattern/map_test.go:9
Function
TestMatcher
(t *testing.T)
pattern/matcher_test.go:12
Function
TestMatcher2
(t *testing.T)
pattern/matcher_test.go:25
Function
TestMatcherWithAnyPattern
(t *testing.T)
pattern/matcher_test.go:186
Function
TestMatcherWithIntersection
(t *testing.T)
pattern/matcher_test.go:598
Function
TestMatcherWithNotPattern
(t *testing.T)
pattern/matcher_test.go:338
Function
TestMatcherWithPatterns
(t *testing.T)
pattern/matcher_test.go:88
Function
TestMatcherWithUnion
(t *testing.T)
pattern/matcher_test.go:462
Function
TestMatcherWithValue
(t *testing.T)
pattern/matcher_test.go:38
Function
TestMatcherWithValues
(t *testing.T)
pattern/matcher_test.go:225
Function
TestMatcherWithWhenPattern
(t *testing.T)
pattern/matcher_test.go:413
Function
TestNot
(t *testing.T)
pattern/not_test.go:9
Function
TestNotPattern
(t *testing.T)
pattern/not_test.go:31
next →
1–100 of 117, ranked by callers