{"id":26234019,"url":"https://github.com/teragrep/rlp_05","last_synced_at":"2026-04-20T16:03:54.955Z","repository":{"id":151693956,"uuid":"619503371","full_name":"teragrep/rlp_05","owner":"teragrep","description":"Go RELP library","archived":false,"fork":false,"pushed_at":"2024-01-09T09:53:38.000Z","size":4177,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-17T19:13:17.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teragrep.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2023-03-27T09:15:42.000Z","updated_at":"2024-01-10T08:16:54.000Z","dependencies_parsed_at":"2023-06-04T04:45:16.851Z","dependency_job_id":null,"html_url":"https://github.com/teragrep/rlp_05","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_05","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_05/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_05/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Frlp_05/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/rlp_05/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318841,"owners_count":20272162,"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":"2025-03-13T01:18:31.917Z","updated_at":"2025-12-28T16:21:47.502Z","avatar_url":"https://github.com/teragrep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[#_rlp_05]\n= rlp_05\n\nGolang RELP library, allows the use of the RELP protocol in Golang.\n\nTested with Go v1.19.\n\n== Basic usage\n\nInitializes an unencrypted RELP connection, and verifies each batch.\n[,go]\n----\nfunc main() {\n    relpSess := RelpConnection{RelpDialer: \u0026RelpPlainDialer{}}\n    // OR: use RelpTLSDialer as the RelpDialer, and configure...\n    relpSess.Init()\n    // ...using relpSess.tlsConfig = \u0026tls.Config{}\n    batch := RelpBatch{}\n    batch.Init()\n    batch.PutRequest(\u0026RelpFrameTX{\n        RelpFrame{\n            cmd:        \"syslog\",\n            dataLength: len([]byte(\"HelloWorld\")),\n            data:       []byte(\"HelloWorld\"),\n        },\n    })\n\n    retry(\u0026relpSess)\n\n    notDone := true\n    for notDone {\n        commitErr := relpSess.Commit(\u0026batch)\n        if commitErr != nil {\n            log.Printf(\"Error committing batch: '%v'\\n\", commitErr.Error())\n        }\n\n        if !batch.VerifyTransactionAll() {\n            batch.RetryAllFailed()\n            retry(\u0026relpSess)\n        } else {\n            notDone = false\n        }\n    }\n\n    relpSess.Disconnect()\n\n    fmt.Println(\"\u003e\u003eDONE\u003c\u003c\")\n    // await for input, so the program doesn't exit\n    a := 0.0\n    fmt.Scanf(\"%f\", \u0026a)\n}\n\nfunc retry(relpSess *RelpConnection) {\n    relpSess.TearDown()\n    var cSuccess bool\n    var cErr error\n    cSuccess, cErr = relpSess.Connect(\"127.0.0.1\", 1601)\n    for !cSuccess || cErr != nil {\n        relpSess.TearDown()\n        time.Sleep(5 * time.Second)\n        cSuccess, cErr = relpSess.Connect(\"127.0.0.1\", 1601)\n    }\n}\n----\n\n== Interface\n\n|===\n|Method or field |Information\n\n|`RelpConnection.Connect(hostname, port)`\n|Initializes a TCP connection to the provided hostname:port address.\n\n|`RelpConnection.RelpDialer`\n|Specifies whether to use `RelpPlainDialer` or `RelpTLSDialer`. Configure the TLS dialer\nwith `RelpConnection.tlsConfig` (after `RelpConnection.Init()` call as the init call uses a blank config)\n\n\n|`RelpConnection.ackTimeoutDuration`\n|Duration, which the connection waits for a new ACK. Timeout will return error to `RelpConnection.Commit()` call.\nDefault is 30 seconds.\n\n|`RelpConnection.writeTimeoutDuration`\n|Duration, which the connection waits for a new write. Timeout will return error to `RelpConnection.Commit()` call.\nDefault is 30 seconds.\n\n|`RelpConnection.Commit(batch)`\n|Sends the RelpBatch given as the argument to the established RELP connection.\n\n|`RelpConnection.Disconnect()`\n|Gracefully disconnects from the server.\n\n|`RelpConnection.TearDown()`\n|Forcefully disconnects from the server.\n\n|`RelpBatch.PutRequest(RelpFrameTX)`\n|Inserts a relp frame to the batch\n\n|`RelpBatch.VerifyTransactionAll()`\n|Verifies that all transactions got acknowledged by the server. Returns boolean.\n\n|`RelpBatch.RetryAllFailed()`\n|Adds all transactions back to the working queue. Restart the connection with tearDown+connect to try again.\n|===\n\n== Contributing\n \n// Change the repository name in the issues link to match with your project's name\n \nYou can involve yourself with our project by https://github.com/teragrep/rlp_05/issues/new/choose[opening an issue] or submitting a pull request.\n \nContribution requirements:\n \n. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.\n. Security checks must pass\n. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.\n. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).\n \nRead more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].\n \n=== Contributor License Agreement\n \nContributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.\n \nYou need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlp_05","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Frlp_05","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Frlp_05/lists"}