go-router | base system design for Soft-routing base

 by   cs8425 Go Version: Current License: No License

kandi X-RAY | go-router Summary

kandi X-RAY | go-router Summary

go-router is a Go library. go-router has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

a base system design for Soft-routing base on go-plugin which provide a simple web interface to use.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              go-router has a low active ecosystem.
              It has 11 star(s) with 0 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              go-router has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of go-router is current.

            kandi-Quality Quality

              go-router has no bugs reported.

            kandi-Security Security

              go-router has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              go-router does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              go-router releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi has reviewed go-router and discovered the below as its top functions. This is intended to give you an instant insight into go-router implemented functionality, and help decide if they suit your requirements.
            • Basic example .
            • Load a plugin
            • RegUserHandler registers a new user in a session
            • OnLoad is called when a plugin is loaded
            • getSid gets session id from http request
            • ReadLines reads lines from a file
            • GetGoStats returns the current status of the process .
            • parseJSONConfig is used to parse a json file .
            • execute command
            • power handler
            Get all kandi verified functions for this library.

            go-router Key Features

            No Key Features are available at this moment for go-router.

            go-router Examples and Code Snippets

            No Code Snippets are available at this moment for go-router.

            Community Discussions

            QUESTION

            Create a Custom Spring Cloud Netflix Ribbon Client
            Asked 2020-Feb-22 at 20:01

            I am using Spring Cloud Netflix Ribbon in combination with Eureka in a Cloud Foundry environment.

            The use case I am trying to implement is the following:

            • I have a running CF application named address-service with several instances spawned.

            • The instances are registering to Eureka by the service name address-service

            • I have added custom metadata to service instances using
              eureka.instance.metadata-map.applicationId: ${vcap.application.application_id}

            • I want to use the information in Eureka's InstanceInfo (in particular the metadata and how many service instances are available) for setting a CF HTTP header "X-CF-APP-INSTANCE" as described here.

            • The idea is to send a Header like "X-CF-APP-INSTANCE":"appIdFromMetadata:instanceIndexCalculatedFromNoOfServiceInstances" and thus "overrule" CF's Go-Router when it comes to load balancing as described at the bottom of this issue.

            I believe to set headers, I need to create a custom RibbonClient implementation - i.e. in plain Netflix terms a subclass of AbstractLoadBalancerAwareClient as described here - and override the execute() methods.

            However, this does not work, as Spring Cloud Netflix Ribbon won't read the class name of my CustomRibbonClient from application.yml. It also seems Spring Cloud Netflix wraps quite a bit of classes around the plain Netflix stuff.

            I tried implementing a subclass of RetryableRibbonLoadBalancingHttpClient and RibbonLoadBalancingHttpClient which are Spring classes. I tried giving their class names in application.yml using ribbon.ClientClassName but that does not work. I tried to override beans defined in Spring Cloud's HttpClientRibbonConfiguration but I cannot get it to work.

            So I have two questions:

            1. is my assumption correct that I need to create a custom Ribbon Client and that the beans defined here and here won't do the trick?

            2. How to do it properly?

            Any ideas are greatly appreciated, so thanks in advance!

            Update-1

            I have dug into this some more and found RibbonAutoConfiguration.

            This creates a SpringClientFactory which provides a getClient() method that is only used in RibbonClientHttpRequestFactory (also declared in RibbonAutoConfiguration).

            Unfortunately, RibbonClientHttpRequestFactory hard-codes the client to Netflix RestClient. And it does not seem possible to override either SpringClientFactory nor RibbonClientHttpRequestFactory beans.

            I wonder if this is possible at all.

            ...

            ANSWER

            Answered 2019-Mar-20 at 22:07

            Ok, I'll answer this question myself, in case someone else may need that in the future.
            Actually, I finally managed to implement it.

            TLDR - the solution is here: https://github.com/TheFonz2017/Spring-Cloud-Netflix-Ribbon-CF-Routing

            The solution:

            • Allows to use Ribbon on Cloud Foundry, overriding Go-Router's load balancing.
            • Adds a custom routing header to Ribbon load balancing requests (including retries) to instruct CF's Go-Router to route requests to the service instance selected by Ribbon (rather than by its own load balancer).
            • Shows how to intercept load balancing requests

            The key to understanding this, is that Spring Cloud has its own LoadBalancer framework, for which Ribbon is just one possible implementation. It is also important to understand, that Ribbon is only used as a load balancer not as an HTTP client. In other words, Ribbon's ILoadBalancer instance is only used to select the service instance from the server list. Requests to the selected server instances are done by an implementation of Spring Cloud's AbstractLoadBalancingClient. When using Ribbon, these are sub-classes of RibbonLoadBalancingHttpClient and RetryableRibbonLoadBalancingHttpClient.

            So, my initial approach to add an HTTP header to the requests sent by Ribbon's HTTP client did not succeed, since Ribbon's HTTP / Rest client is actually not used by Spring Cloud at all.

            The solution is to implement a Spring Cloud LoadBalancerRequestTransformer which (contrary to its name) is a request interceptor.

            My solution uses the following implementation:

            Source https://stackoverflow.com/questions/55151079

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install go-router

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cs8425/go-router.git

          • CLI

            gh repo clone cs8425/go-router

          • sshUrl

            git@github.com:cs8425/go-router.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link