Skip to content

Set up :core module with Ktor client and base request/response model #10

@syncended

Description

@syncended

Goal

Introduce a shared :core Gradle module that holds the domain model and HTTP engine used by both :cli and the future TUI module. This is the architectural foundation for #4.

Scope

  • New Gradle module :core (Kotlin/JVM, JDK 21).
  • :cli depends on :core.
  • Add Ktor client to gradle/libs.versions.toml (engine TBD — likely ktor-client-cio or ktor-client-okhttp).
  • Add kotlinx.serialization for JSON.
  • Domain model:
    • HttpMethod enum (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS).
    • Request data class (method, url, query params, headers, body).
    • Body sealed class: Raw(text, contentType), Json(value), FormUrlEncoded(fields), Multipart(parts).
    • Response data class (status, headers, body bytes, elapsed time, content-type).
  • RequestExecutor interface + Ktor-backed implementation. Coroutine-based.
  • Unit tests for body serialization variants.
  • Integration test for executor against a small embedded mock server (Ktor server or MockEngine).

Out of scope

Acceptance criteria

  • :core module builds and tests pass in CI.
  • :cli can import and call RequestExecutor to send a real HTTP request.
  • No CLI/TUI-specific code lives in :core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions