prysm-pulse/cmd/beacon-chain/flags/api_module.go

24 lines
475 B
Go
Raw Normal View History

package flags
import "strings"
const PrysmAPIModule string = "prysm"
const EthAPIModule string = "eth"
func EnableHTTPPrysmAPI(httpModules string) bool {
return enableAPI(httpModules, PrysmAPIModule)
}
func EnableHTTPEthAPI(httpModules string) bool {
return enableAPI(httpModules, EthAPIModule)
}
func enableAPI(httpModules, api string) bool {
for _, m := range strings.Split(httpModules, ",") {
if strings.EqualFold(m, api) {
return true
}
}
return false
}