{"id":19251028,"url":"https://github.com/onesignal/linebased","last_synced_at":"2025-04-21T12:33:40.513Z","repository":{"id":52444161,"uuid":"64039383","full_name":"OneSignal/linebased","owner":"OneSignal","description":"Drop-in TCP command server","archived":false,"fork":false,"pushed_at":"2021-06-02T18:54:04.000Z","size":4026,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":34,"default_branch":"main","last_synced_at":"2024-10-31T11:29:31.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/linebased","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OneSignal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-23T23:01:36.000Z","updated_at":"2024-01-29T13:31:48.000Z","dependencies_parsed_at":"2022-09-13T03:32:04.996Z","dependency_job_id":null,"html_url":"https://github.com/OneSignal/linebased","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Flinebased","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Flinebased/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Flinebased/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OneSignal%2Flinebased/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OneSignal","download_url":"https://codeload.github.com/OneSignal/linebased/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223864899,"owners_count":17216429,"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-09T18:19:40.844Z","updated_at":"2024-11-09T18:19:41.444Z","avatar_url":"https://github.com/OneSignal.png","language":"Rust","readme":"# linebased\n\n[![Build Status](https://travis-ci.org/jwilm/linebased.svg?branch=master)](https://travis-ci.org/jwilm/linebased)\n[![Crates.io](https://img.shields.io/crates/v/linebased.svg)](https://crates.io/crates/linebased)\n\nDrop-in TCP command server\n\n## About\n\nSimple line-based TCP server for implementing command interfaces. There's no\nauthentication or TLS support. Commands are handled synchronously as in Redis.\nThe server uses an event loop internally to multiplex client connections.\n\n## Usage\n\nThis example is kept up-to-date on a best-effort basis. For a guaranteed acurate\nexample, please see the [docs].\n\n```rust\n#[tokio::main]\nasync fn main() {\n    let config = Config::default()\n        .host(\"127.0.0.1\")\n        .port(5555)\n        .max_clients(32)\n        .client_buf_size(1024);\n\n    let mut server = Server::new(config, |query| {\n        match query {\n            \"version\" =\u003e String::from(\"0.1.0\"),\n            _ =\u003e String::from(\"unknown command\"),\n        }\n    }).unwrap();\n\n    server.run().await.unwrap();\n}\n```\n\nThis can be accessed over netcat like so:\n\n```\njwilm@jwilm-desk ➜ nc localhost 5555\narst\nunknown command\nversion\n0.1.0\n```\n\n[docs]: http://blog.jwilm.io/linebased/linebased/index.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Flinebased","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonesignal%2Flinebased","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonesignal%2Flinebased/lists"}