Skip to content

Commit

Permalink
Fix variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Navarro Perez <[email protected]>
  • Loading branch information
ajnavarro committed Dec 6, 2022
1 parent 0f77cb6 commit f0e987e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions config/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -151,7 +151,7 @@ type HttpRouterParams struct {
MaxProvideConcurrency int
}

func (hrp *HttpRouterParams) FillDefaults() {
func (hrp *HTTPRouterParams) FillDefaults() {
if hrp.MaxProvideBatchSize == 0 {
hrp.MaxProvideBatchSize = 100
}
Expand Down
4 changes: 2 additions & 2 deletions routing/delegated.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit f0e987e

Please sign in to comment.