https://github.com/mlk/feign-guice
A module to marry together Feign bound resources to the Guice dependency injection framework
https://github.com/mlk/feign-guice
feign guice hacktoberfest java
Last synced: 6 months ago
JSON representation
A module to marry together Feign bound resources to the Guice dependency injection framework
- Host: GitHub
- URL: https://github.com/mlk/feign-guice
- Owner: mlk
- License: mit
- Created: 2016-03-24T15:09:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-28T13:55:51.000Z (about 10 years ago)
- Last Synced: 2025-08-03T01:07:27.480Z (11 months ago)
- Topics: feign, guice, hacktoberfest, java
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/mlk/feign-guice) [](https://codecov.io/github/mlk/feign-guice?branch=master)
# feign-guice
A module to marry together Feign bound resources to the Guice dependency injection framework.
```
public static void main(String... arg) {
Injector injector = Guice.createInjector(FeignModule.builder()
// Setting the builder here is optional, if not set it will ask Guice for one.
.withBuilder(Feign.builder().decoder(new GsonDecoder()))
// The base URL is required.
.withUrl("https://api.github.com")
// The packages to scan.
.scan("com.github.mlk.guice.api").build());
GitHub github = injector.getInstance(GitHub.class);
List contributors = github.contributors("netflix", "feign");
for (Contributor contributor : contributors) {
System.out.println(contributor.login + " (" + contributor.contributions + ")");
}
```
It is on Maven, so use it with:
```
com.github.mlk
feign-guice
1.0.0
```