INNER CODE UNIT · Go
weighted
go-kratos/gateway · client/factory.go:116
weighted := backend.Weight // weight is only valid for direct scheme
node := newNode(na.buildContext, backend.Target, na.endpoint.Protocol, weighted, backend.Metadata, "", "", WithTLS(backend.Tls), WithTLSConfigName(backend.TlsConfigName))
nodes = append(nodes, node)
na.picker.Apply(nodes)
case "discovery":
existed := AddWatch(ctx, na.registry, target.Endpoint, na)
if existed {
log.Infof("watch target %+v already existed", target)
}
default:
return fmt.Errorf("unknown scheme: %s", target.Scheme)
}
}
return nil
}
var _defaultWeight = int64(10)