Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

sya-ri/Gofile.kt

Repository files navigation

GoFile logo Gofile.kt

Kotlin GitHub License Maven Central KDoc link Build status

A kotlin wrapper for the Gofile.io API.

Features

  • Support multiplatform.
    • JVM
    • JS
    • Native
      • Android
        • androidNativeX86 (yet)
        • androidNativeX64 (yet)
        • androidNativeArm32 (yet)
        • androidNativeArm64 (yet)
      • Linux
        • linuxArm64
        • linuxX64
        • mingwX64
      • MacOS
        • macosArm64
        • macosX64
      • iOS
        • iosArm64
        • iosSimulatorArm64
        • iosX64
      • tvOS
        • tvosArm64
        • tvosSimulatorArm64
        • tvosX64
      • watchOS
        • watchosArm32
        • watchosArm64
        • watchosSimulatorArm64
        • watchosDeviceArm64 (yet)
        • watchosX64
  • Supports all endpoints. (API Version: 2023-04-20)
    • getServer
    • uploadFile
    • getContent
    • createFolder
    • setOption
    • copyContent
    • deleteContent
    • getAccountDetails
  • Support all account tiers.
    • Guest (without token)
    • Standard
    • Donor
  • Error handling using Result.
  • Asynchronous with Ktor.

Installation

Add dependency

You also need to add Ktor client engine.

build.gradle.kts

repositories {
    mavenCentral()
}

dependencies {
    implementation("dev.s7a:gofile:1.1.0")
    // See also: https://ktor.io/docs/http-client-engines.html
    // implementation("io.ktor:ktor-client-???:$ktor_version")
}

build.gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation "dev.s7a:gofile:1.1.0"
    // See also: https://ktor.io/docs/http-client-engines.html
    // implementation "io.ktor:ktor-client-???:$ktor_version"
}

Main.kt

import dev.s7a.gofile.GofileClient

fun main() {
    val client = GofileClient() // Automatically find the engine
    // client.uploadFile(), etc...
}

Documentation