-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
203bc0f
commit 260cc1a
Showing
7 changed files
with
97 additions
and
45 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/org/springframework/cloud/gateway/api/RouteReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.springframework.cloud.gateway.api; | ||
|
||
import org.springframework.cloud.gateway.config.Route; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Spencer Gibb | ||
*/ | ||
public interface RouteReader { | ||
|
||
List<Route> getRoutes(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/org/springframework/cloud/gateway/config/PropertiesRouteReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.springframework.cloud.gateway.config; | ||
|
||
import org.springframework.cloud.gateway.api.RouteReader; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Spencer Gibb | ||
*/ | ||
public class PropertiesRouteReader implements RouteReader { | ||
|
||
private final GatewayProperties properties; | ||
|
||
public PropertiesRouteReader(GatewayProperties properties) { | ||
this.properties = properties; | ||
} | ||
|
||
@Override | ||
public List<Route> getRoutes() { | ||
return this.properties.getRoutes(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 9 additions & 11 deletions
20
src/main/java/org/springframework/cloud/gateway/handler/GatewayWebHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters