{"id":19895389,"url":"https://github.com/razshare/kotlin-result","last_synced_at":"2025-09-07T10:36:19.263Z","repository":{"id":214510172,"uuid":"736667059","full_name":"razshare/kotlin-result","owner":"razshare","description":"A simple standalone utility library for managing unsafe results in Kotlin instead of throwing exceptions.","archived":false,"fork":false,"pushed_at":"2024-05-09T22:12:30.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T09:12:41.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/razshare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-28T14:28:17.000Z","updated_at":"2024-05-09T22:12:33.000Z","dependencies_parsed_at":"2023-12-28T17:24:49.396Z","dependency_job_id":"fb648bc0-c00c-4ee8-bc6e-c547b1a7a4a0","html_url":"https://github.com/razshare/kotlin-result","commit_stats":null,"previous_names":["tncrazvan/kotlin-unsafe","razshare/kotlin-result"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/razshare/kotlin-result","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fkotlin-result","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fkotlin-result/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fkotlin-result/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fkotlin-result/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razshare","download_url":"https://codeload.github.com/razshare/kotlin-result/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fkotlin-result/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263013703,"owners_count":23399812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:36:33.527Z","updated_at":"2025-07-01T18:04:19.347Z","avatar_url":"https://github.com/razshare.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin Result\n\nThis is a simple standalone utility library for managing unsafe results in Kotlin instead of throwing exceptions.\n\n```kt\nimport dev.razshare.result.Result\nimport dev.razshare.result.success\nimport dev.razshare.result.failure\n\ndata class User(val username: String, val password: String)\n\nfun validateUser(user: User): Result\u003cUser\u003e {\n    if(user.password.length \u003c 4){\n        return failure(\"User password must be at least 4 characters, received ${user.password.length} characters.\")\n    }\n\n    return success(user)\n}\n\nfun main(){\n    val (user, error) = validateUser(User(username = \"foo\", password = \"bar\")).unwrap()\n\n    if(error.isPresent){\n        println(error.get)\n        return\n    }\n\n    println(\"User ${user.username} is valid.\")\n}\n```\n\n# Using Gradle Kotlin\n\n- Add the repository to your `build.gradle.kts`\n  ```kt\n  repositories {\n      maven {\n          url = uri(\"https://raw.githubusercontent.com/tncrazvan/artifacts/main\")\n          metadataSources {\n              mavenPom()\n              artifact()\n              ignoreGradleMetadataRedirection()\n          }\n      }\n  }\n  ```\n\n- Add the library to your `build.gradle.kts`, for example `dev.razshare.result`\n  ```kt\n  dependencies {\n      implementation(\"dev.razshare:result:0.1.0\")\n  }\n  ```\n\n# Using Maven\n\n- Add the repository to your `pom.xml`\n  ```xml\n  \u003crepositories\u003e\n      \u003crepository\u003e\n          \u003cid\u003edev.razshare\u003c/id\u003e\n          \u003curl\u003ehttps://raw.githubusercontent.com/tncrazvan/artifacts/main\u003c/url\u003e\n      \u003c/repository\u003e\n  \u003c/repositories\u003e\n  ```\n\n- Add the library to your `pom.xml`, for example `dev.razshare.result`\n  ```xml\n  \u003cdependencies\u003e\n      \u003cdependency\u003e\n          \u003cgroupId\u003edev.razshare\u003c/groupId\u003e\n          \u003cartifactId\u003eresult\u003c/artifactId\u003e\n          \u003cversion\u003e0.1.0\u003c/version\u003e\n          \u003ctype\u003ejar\u003c/type\u003e\n      \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fkotlin-result","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazshare%2Fkotlin-result","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fkotlin-result/lists"}