downloadRepositoryArchive

fun GithubApi.downloadRepositoryArchive(repositoryName: String, compressionType: CompressionType = CompressionType.ZIP, ref: String = "main"): Flow<ByteBuffer>

Downloads the archive of the specified GitHub repository.

Return

A Flow<ByteBuffer> object representing the content of the repository archive.

Example usage:

val githubApi = GithubApi("your_api_key_here")
val repositoryName = "owner/repo_name"
val compressionType = CompressionType.ZIP
val ref = "main"
val archiveFlow = githubApi.downloadRepositoryArchive(repositoryName, compressionType, ref)
archiveFlow.collect { byteBuffer -> ... }

Parameters

repositoryName

The name of the GitHub repository.

compressionType

The type of compression for the archive (ZIP or TAR). Defaults to ZIP.

ref

The reference to a branch or commit for the archive. Defaults to "main".