{"id":13562333,"url":"https://github.com/Synternet/data-layer-sdk","last_synced_at":"2025-04-03T18:33:23.945Z","repository":{"id":206535800,"uuid":"717088673","full_name":"Synternet/data-layer-sdk","owner":"Synternet","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-20T22:53:07.000Z","size":220,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-20T23:29:12.685Z","etag":null,"topics":["go","golang","sdk"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Synternet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","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-11-10T14:32:14.000Z","updated_at":"2025-02-13T09:07:50.000Z","dependencies_parsed_at":"2024-02-22T22:28:57.019Z","dependency_job_id":"87846985-ebf5-41d8-98b5-6361f9db0a75","html_url":"https://github.com/Synternet/data-layer-sdk","commit_stats":null,"previous_names":["syntropynet/data-layer-sdk","synternet/data-layer-sdk"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Synternet%2Fdata-layer-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Synternet%2Fdata-layer-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Synternet%2Fdata-layer-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Synternet%2Fdata-layer-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Synternet","download_url":"https://codeload.github.com/Synternet/data-layer-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247057013,"owners_count":20876495,"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":["go","golang","sdk"],"created_at":"2024-08-01T13:01:07.327Z","updated_at":"2025-04-03T18:33:18.930Z","avatar_url":"https://github.com/Synternet.png","language":"Go","readme":"# Synternet Data Layer SDK\n\nWelcome to the [Data Layer SDK](https://github.com/Synternet/data-layer-sdk) documentation. This SDK enables seamless integration with our Data Layer solution, allowing you to harness the power of real-time data streams in your Golang applications.\n\n[data-layer-sdk](https://github.com/Synternet/data-layer-sdk) is a [Golang library](https://github.com/Synternet/data-layer-sdk) designed specifically for the Synternet Data Layer project. Powered by the NATS messaging system, [data-layer-sdk](https://github.com/Synternet/data-layer-sdk) abstracts away most of the intricate details of interacting\nwith the Data Layer Broker network and the Blockchain to offer seamless integration between your Golang applications and the Synternet Data Layer platform.\n\n# Features\n\n- **Subscribe to Existing Data Streams**: Easily subscribe to pre-existing data streams within the Synternet Data Layer. Receive real-time updates and harness the power of real-time data insights in your Golang applications.\n\n- **Publish New Data Streams**: Create and publish your own data streams directly from your Golang applications. Share data with other participants in the Data Layer, facilitating collaboration and enabling the creation of innovative data-driven solutions.\n\n- **Support for JSON Messages**: Leverage the flexibility and interoperability of JSON messages. [data-layer-sdk](https://github.com/Synternet/data-layer-sdk) provides support for handling JSON data, making it easy to work with complex data structures and seamlessly integrate with other systems and platforms. Even more, the SDK allows adding your own type marshallers to support any wire data format.\n\n- **Customizable Connection Options**: Tailor the connection options to suit your specific needs. Configure parameters such as connection timeouts, retry mechanisms, and authentication details to ensure a secure and reliable connection to the Synternet Data Layer platform.\n\n# Installation\n\nTo install the SDK for Data Layer, you can use Go modules or include it as a dependency in your project. Here's an example of how to add it to your project:\n\n```shell\ngo get github.com/synternet/data-layer-sdk\n```\n\nMake sure to import the package in your code:\n\n```go\nimport \"github.com/synternet/data-layer-sdk\"\n```\n\n## Getting started\nIn order to implement a simple publisher, you may want to embed `service.Service` into your publisher's struct.\nThen in the constructor call `Service.Configure` that will use options to configure the publisher.\nAfter that it is as simple as running `Start` on your publisher.\n\nThe minimal example is as follows:\n\n```go\ntype Publisher struct {\n\t*service.Service\n}\n\n// Define custom payload messages\ntype MyMessage struct {\n\tRequestWas []byte `json:\"request\"`\n}\n\nfunc New(o ...options.Option) (*Publisher, error) {\n\tret := \u0026Publisher{\n\t\tService: \u0026service.Service{},\n\t}\n\n\terr := ret.Service.Configure(o...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed configuring the publisher: %w\", err)\n\t}\n\n\treturn ret, nil\n}\n\nfunc (p *Publisher) Start() \u003c-chan error {\n\terr := p.subscribe()\n\tif err != nil {\n\t\tgo func() {\n\t\t\tp.ErrCh \u003c- err\n\t\t}()\n\t\treturn p.ErrCh\n\t}\n\n\treturn p.Service.Start()\n}\n\nfunc (p *Publisher) subscribe() error {\n  // Do any necessary subscriptions\n\treturn nil\n}\n```\n\n# Tools\n\n## User credentials generator\n\nCLI tool to generate user credentials (`JWT`, `NKEY`) from account credentials (`NKEY`) issued in [Portal](https://portal.synternet.com/). To learn more about Synternet used NATS auth model click [here](https://docs.nats.io/running-a-nats-service/configuration/securing_nats/auth_intro/jwt)\n```bash\ngo run github.com/synternet/data-layer-sdk/cmd/gen-user@latest\n```\n\n# Contributing\n\nWe welcome contributions from the community! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/Synternet/data-layer-sdk). We appreciate your feedback and collaboration in making this SDK even better.\n\n## Contribution Guidelines\n\nTo contribute to this project, please follow the guidelines outlined in the [Contribute.md](CONTRIBUTE.md) file. It covers important information about how to submit bug reports, suggest new features, and submit pull requests.\n\n## Code of Conduct\nThis project adheres to a [Code of Conduct](CODE-OF-CONDUCT.md) to ensure a welcoming and inclusive environment for all contributors. Please review the guidelines and make sure to follow them in all interactions within the project.\n\n## Commit Message Format\nWhen making changes to the codebase, it's important to follow a consistent commit message format. Please refer to the [Commit Message Format](commit-template.md) for details on how to structure your commit messages.\n\n## Pull Request Template\nTo streamline the pull request process, we have provided a [Pull Request Template](pull-request-template.md) that includes the necessary sections for describing your changes, related issues, proposed changes, and any additional information. Make sure to fill out the template when submitting a pull request.\n\nWe appreciate your contributions and thank you for your support in making this project better!\n\n# Support\n\nIf you encounter any difficulties or have questions regarding the Data Layer SDK, please reach out to our support team at [Discord #developer-discussion](https://discord.com/channels/503896258881126401/1125658694399561738). We are here to assist you and ensure a smooth experience with our SDK.\n\nWe hope this documentation provides you with a comprehensive understanding of the Golang SDK for the Data Layer. Happy coding with real-time data streams and enjoy the power of the Data Layer in your Golang applications!\n","funding_links":[],"categories":["Official SDKs","Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSynternet%2Fdata-layer-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSynternet%2Fdata-layer-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSynternet%2Fdata-layer-sdk/lists"}