Feign Guice

Binds Feign resources into the Guice dependency injection framework.

License

License

MIT License
Categories

Categories

GUI User Interface Guice Application Layer Libs Dependency Injection Feign Net HTTP Clients
GroupId

GroupId

com.github.mlk
ArtifactId

ArtifactId

feign-guice
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Feign Guice
Binds Feign resources into the Guice dependency injection framework.
Project URL

Project URL

https://github.com/mlk/magical-provider-guice
Source Code Management

Source Code Management

http://github.com/mlk/feign-guice

Download feign-guice

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mlk/feign-guice/ -->
<dependency>
    <groupId>com.github.mlk</groupId>
    <artifactId>feign-guice</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mlk/feign-guice/
implementation 'com.github.mlk:feign-guice:1.0.0'
// https://jarcasting.com/artifacts/com.github.mlk/feign-guice/
implementation ("com.github.mlk:feign-guice:1.0.0")
'com.github.mlk:feign-guice:jar:1.0.0'
<dependency org="com.github.mlk" name="feign-guice" rev="1.0.0">
  <artifact name="feign-guice" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mlk', module='feign-guice', version='1.0.0')
)
libraryDependencies += "com.github.mlk" % "feign-guice" % "1.0.0"
[com.github.mlk/feign-guice "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.github.mlk : magical-provider-guice jar 1.0.1
com.netflix.feign : feign-core jar 8.15.1

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.9.5
com.netflix.feign : feign-gson jar 8.15.1

Project Modules

There are no modules declared in this project.

Build Status codecov.io

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<Contributor> contributors = github.contributors("netflix", "feign");
        for (Contributor contributor : contributors) {
            System.out.println(contributor.login + " (" + contributor.contributions + ")");
        }

It is on Maven, so use it with:

<dependency>
  <groupId>com.github.mlk</groupId>
  <artifactId>feign-guice</artifactId>
  <version>1.0.0</version>
</dependency>

Versions

Version
1.0.0