Micronaut Java library to consume the Gitter REST API
This project is a Java libray to consume the Gitter REST API. It is built with the Micronaut Framework and you can use it in a Micronaut app or as a standalone library.
To use it with https://gradle.org[Gradle]:
implementation 'com.softamo.gitter:gitter-rest-api:XXXX'
To use it with https://maven.apache.org[Maven]:
<dependency>
<groupId>com.softamo.gitter</groupId>
<artifactId>gitter-rest-api</artifactId>
<version>xxx</version>
<type>pom</type>
</dependency>
If you want to use the library in a Micronaut application, the library registers in the Micronaut's application context beans of type como.softamo.gitter.restapi.GitterApi
and como.softamo.gitter.restapi.BlockingGitterApi
if you have a bean of type GitterConfiguration
. Providing configuration for your gitter token, registers a bean of type `GitterConfiguration.
gitter:
token: 'xxx'
You can use the library without a Micronaut Application Context. In that case, instantiate DefaultBlockingGitterApi
or DefaultGitterApi
.
BlockingGitterApi gitterApi = new DefaultBlockingGitterApi(() -> "xxxx", new ManualBlockingGitterClient());
or
GitterApi gitterApi = new DefaultGitterApi(() -> "xxxx", new ManualGitterClient());
It is easy to send messages:
gitterApi.sendMessage(roomId, "Hello World");
You can obtain the room id by getting a list of rooms.
gitterApi.findAllRooms();
This library uses https://gradle.org[Gradle].
It uses the plugins:
- Make sure version ends with
-SNAPSHOT
./gradlew publish
- bump up version
- Tag it. E.g. v1.0.0
./gradlew publishToSonatype closeSonatypeStagingRepository
Go to https://s01.oss.sonatype.org/#stagingRepositories
and release repository.