All Projects → rarnu → ktfunctional

rarnu / ktfunctional

Licence: GPL-3.0 license
a functional library for kotlin(android)

Programming Languages

kotlin
9241 projects

Labels

Projects that are alternatives of or similar to ktfunctional

xodus-entity-browser
Web UI entity browser for xodus database
Stars: ✭ 56 (+194.74%)
Mutual labels:  ktor
Kodein Di
Painless Kotlin Dependency Injection
Stars: ✭ 2,692 (+14068.42%)
Mutual labels:  ktor
Lavalink.kt
Coroutine based client for Lavalink (Kotlin and Java)
Stars: ✭ 31 (+63.16%)
Mutual labels:  ktor
ktor-hexagonal-multimodule
Template project to build ktor-based multi-module web service with Kotlin using Hexagonal architecture
Stars: ✭ 30 (+57.89%)
Mutual labels:  ktor
Saga
Saga pattern implementation in Kotlin build in top of Kotlin's Coroutines.
Stars: ✭ 24 (+26.32%)
Mutual labels:  ktor
api-service
The REST API backend server for the Jalgaon CoHelp application. Built with Kotlin Ktor.
Stars: ✭ 26 (+36.84%)
Mutual labels:  ktor
meu kumbu
💵Meu Kumbu 💰 (Means My Money) is a template app that people can use to build their owns Wallet 🤑 or a mobile 🏦 banking app.
Stars: ✭ 55 (+189.47%)
Mutual labels:  ktor
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+278.95%)
Mutual labels:  ktor
kinsight-multiplatform
Kotlin Multiplatform Concept - iOS, MacOS, WatchOS (SwiftUI), Android (phone and Wear OS), JVM Web Server - Alpha Capture
Stars: ✭ 38 (+100%)
Mutual labels:  ktor
Scout
Scout is a kotlin multiplatform application that allows users to search and save games to lists to be browsed later.
Stars: ✭ 28 (+47.37%)
Mutual labels:  ktor
kompendium
Ktor OpenAPI Spec Generator
Stars: ✭ 46 (+142.11%)
Mutual labels:  ktor
ktor-health-check
Simple, opinionated health checks Kubernetes-style health checks for ktor
Stars: ✭ 26 (+36.84%)
Mutual labels:  ktor
github-profile
See Your Github Profile Summary
Stars: ✭ 21 (+10.53%)
Mutual labels:  ktor
RiRi
An optical character recognition mobile application built using Kotlin Multiplatform Mobile and Azure Cognitive Services
Stars: ✭ 31 (+63.16%)
Mutual labels:  ktor
ThinkRchive
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.
Stars: ✭ 84 (+342.11%)
Mutual labels:  ktor
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (+63.16%)
Mutual labels:  ktor
CleanArchitecture
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.
Stars: ✭ 271 (+1326.32%)
Mutual labels:  ktor
obsidian
◼️ A standalone audio sending node for music bots.
Stars: ✭ 22 (+15.79%)
Mutual labels:  ktor
ktor-features-zipkin
A Ktor feature that handles Open Zipkin tracing IDs
Stars: ✭ 15 (-21.05%)
Mutual labels:  ktor
sample-kotlin-ktor-microservices
sample microservices written in Kotlin that demonstrates usage of Ktor framework woth Consul server
Stars: ✭ 37 (+94.74%)
Mutual labels:  ktor

ktfunctional

a functional library for kotlin

Using in Android

implementation "com.github.rarnu:ktfunctional:0.9.0"

Using in Kotlin Project

compile "com.github.rarnu:common:0.9.1"

Using in Ktor

compile "com.github.rarnu:ktor:0.2.0"

Try this

fileIO {
    src = "/sdcard/a.txt"
    isDestText = true
    result { status, text, errMsg ->
        if (status) {
            Log.e(tag, "$text")
        } else {
            Log.e(tag, "$errMsg")
        }
    }
}

fileIO {
    src = "/sdcard/a.txt"
    dest = "/sdcard/b.txt"
    result { status, text, errMsg ->
        if (status) {
            Log.e(tag, "ok")
        } else {
            Log.e(tag, "$errMsg")
        }
    }
}

runCommand {
    commands.add("ls")
    commands.add("/sdcard/")
    result { output, error ->
        Log.e(tag, "output => $output, error => $error")
    }
}

UI.init(ctx)
val padding = 8.dip2px()

Usage for Ktor

access database

ktor {
    ... ...
    database {
        driver = "com.mysql.cj.jdbc.Driver"
        url = "jdbc:mysql://localhost:3306/SampleDB?useUnicode=true&characterEncoding=UTF-8"
        user = "root"
        password = "root"
    }
}

You may access application.conn for a database connection after that.

session & plugins

installPlugin<MySession>(sessionIdentifier = "MySession", headers = mapOf("X-Engine" to "Ktor")) { 
    ... ...
}

inline your customized session:

inline val PipelineContext<*, ApplicationCall>.mySession: MySession
    get() = session {
        MySession(UUID.randomUUID().toString())
    }

save a file from POST

val file = call.receiveMultipart().file("file")
"${call.config("ktor.image.path")}/$uuid".asFileMkdirs()
file.save(File("${call.config("ktor.image.path")}/$uuid/upload.jpg"))

Inside the library there are many other ktor features.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].