mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 03:01:19 +00:00
12480e12b2
* Add flags for disabling selected API * tests * build file * Use comma-separated modules * test fix * fix gateway tests * fix import in flag tests
24 lines
482 B
Go
24 lines
482 B
Go
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 string, api string) bool {
|
|
for _, m := range strings.Split(httpModules, ",") {
|
|
if strings.EqualFold(m, api) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|