commonMain.com.saveourtool.save.utils.github.GitHubRepoInfo.kt Maven / Gradle / Ivy
The newest version!
package com.saveourtool.save.utils.github
/**
* Interface which provides info about GitHub repo
*/
interface GitHubRepoInfo {
/**
* organizationName of this GitHub repo
*/
val organizationName: String
/**
* projectName of this GitHub repo
*/
val projectName: String
/**
* @param tagName
* @return URL to request metadata for provided [tagName]
*/
fun getMetadataUrl(tagName: String): String = if (tagName == GitHubHelper.LATEST_VERSION) {
tagName
} else {
"tags/$tagName"
}
.let { release ->
"${GitHubHelper.API_URL}/$organizationName/$projectName/releases/$release"
}
/**
* @return URL to request tags
*/
fun getTagsUrl(): String = "${GitHubHelper.API_URL}/$organizationName/$projectName/tags"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy