go-waku/waku/v2/protocol/utils.go

16 lines
356 B
Go

package protocol
import "strings"
func FulltextMatch(expectedProtocol string) func(string) bool {
return func(receivedProtocol string) bool {
return receivedProtocol == expectedProtocol
}
}
func PrefixTextMatch(prefix string) func(string) bool {
return func(receivedProtocol string) bool {
return strings.HasPrefix(receivedProtocol, prefix)
}
}