jonasfranz / gitea-client

Kotlin based API client for Gitea

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API-Client for Gitea

Download Build status

A Kotlin based API client for Gitea.

This project is actually under construction.

Support

  • JavaScript (JS)
  • Java (JVM)

Example

fun createStatus() = async {
    val client = Client("https://your.gitea.instance/api/v1", "YOUR-API-KEY")
    val repository = client.repositories.getRepo("organization", "reponame")
    val status = repository.createStatus("COMMIT-SHA",
                        Status.CreateStatusOption(
                                state = "warning",
                                context = "API Client Test",
                                description =  "A status created during an automated test",
                                targetURL = "https://github.com/JonasFranzDEV/gitea-client"
                        )
                )
    println(status.createdAt.getTime())
}

Using gitea-client

Gradle-based project

Add the gitea client repository to your module

repositories {
    jcenter()
    maven { url "https://kotlin.bintray.com/kotlinx" }
    maven { url "https://dl.bintray.com/jonasfranzdev/gitea-client" }
}

Common

If you have a multi platform project please add the common dependency to your common module. Please also add the JVM and JS dependency to your JS/JVM module.

compile 'de.jonasfranz.gitea:gitea-client-common:0.0.6'

JVM

compile 'de.jonasfranz.gitea:gitea-client:0.0.6'

JS

compile 'de.jonasfranz.gitea:gitea-client-js:0.0.6'

License

This project is licensed under the MIT License. See the LICENSE file for the full license text.

About

Kotlin based API client for Gitea

License:MIT License


Languages

Language:Kotlin 100.0%