mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Fix variable name
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
This commit is contained in:
parent
df828c0a47
commit
401a543f4c
@ -79,8 +79,8 @@ func (r *RouterParser) UnmarshalJSON(b []byte) error {
|
||||
|
||||
var p interface{}
|
||||
switch out.Type {
|
||||
case RouterTypeHttp:
|
||||
p = &HttpRouterParams{}
|
||||
case RouterTypeHTTP:
|
||||
p = &HTTPRouterParams{}
|
||||
case RouterTypeReframe:
|
||||
p = &ReframeRouterParams{}
|
||||
case RouterTypeDHT:
|
||||
@ -107,7 +107,7 @@ type RouterType string
|
||||
|
||||
const (
|
||||
RouterTypeReframe RouterType = "reframe"
|
||||
RouterTypeHttp RouterType = "http"
|
||||
RouterTypeHTTP RouterType = "http"
|
||||
RouterTypeDHT RouterType = "dht"
|
||||
RouterTypeSequential RouterType = "sequential"
|
||||
RouterTypeParallel RouterType = "parallel"
|
||||
@ -139,7 +139,7 @@ type ReframeRouterParams struct {
|
||||
Endpoint string
|
||||
}
|
||||
|
||||
type HttpRouterParams struct {
|
||||
type HTTPRouterParams struct {
|
||||
// Endpoint is the URL where the routing implementation will point to get the information.
|
||||
Endpoint string
|
||||
|
||||
@ -151,7 +151,7 @@ type HttpRouterParams struct {
|
||||
MaxProvideConcurrency int
|
||||
}
|
||||
|
||||
func (hrp *HttpRouterParams) FillDefaults() {
|
||||
func (hrp *HTTPRouterParams) FillDefaults() {
|
||||
if hrp.MaxProvideBatchSize == 0 {
|
||||
hrp.MaxProvideBatchSize = 100
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ func parse(visited map[string]bool,
|
||||
var router routing.Routing
|
||||
var err error
|
||||
switch cfg.Type {
|
||||
case config.RouterTypeHttp:
|
||||
case config.RouterTypeHTTP:
|
||||
router, err = httpRoutingFromConfig(cfg.Router, extraHTTP)
|
||||
case config.RouterTypeReframe:
|
||||
router, err = reframeRoutingFromConfig(cfg.Router, extraHTTP)
|
||||
@ -158,7 +158,7 @@ type ExtraHTTPParams struct {
|
||||
}
|
||||
|
||||
func httpRoutingFromConfig(conf config.Router, extraHTTP *ExtraHTTPParams) (routing.Routing, error) {
|
||||
params := conf.Parameters.(*config.HttpRouterParams)
|
||||
params := conf.Parameters.(*config.HTTPRouterParams)
|
||||
if params.Endpoint == "" {
|
||||
return nil, NewParamNeededErr("Endpoint", conf.Type)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user