{"id":39384689,"url":"https://github.com/techerfan/panda","last_synced_at":"2026-01-18T03:02:12.100Z","repository":{"id":57624917,"uuid":"399415802","full_name":"techerfan/panda","owner":"techerfan","description":"A module for simplifying the use of WebSocket.","archived":false,"fork":false,"pushed_at":"2024-10-29T10:58:16.000Z","size":82,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-29T11:07:12.933Z","etag":null,"topics":["event-driven","go","golang","publish-subscribe","websocket"],"latest_commit_sha":null,"homepage":"","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/techerfan.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":"2021-08-24T09:58:02.000Z","updated_at":"2024-10-29T10:56:24.000Z","dependencies_parsed_at":"2024-04-15T10:47:14.541Z","dependency_job_id":"ea5bb1ff-e0bb-4ee2-883b-8b41f6636fff","html_url":"https://github.com/techerfan/panda","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/techerfan/panda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techerfan%2Fpanda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techerfan%2Fpanda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techerfan%2Fpanda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techerfan%2Fpanda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techerfan","download_url":"https://codeload.github.com/techerfan/panda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techerfan%2Fpanda/sbom","scorecard":{"id":871890,"data":{"date":"2025-08-11","repo":{"name":"github.com/techerfan/panda","commit":"6b4b3395c99a91cda1e13d6821c50e1b0b51e930"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/techerfan/panda/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/techerfan/panda/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/techerfan/panda/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/techerfan/panda/codeql-analysis.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T04:31:55.120Z","repository_id":57624917,"created_at":"2025-08-24T04:31:55.120Z","updated_at":"2025-08-24T04:31:55.120Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["event-driven","go","golang","publish-subscribe","websocket"],"created_at":"2026-01-18T03:02:11.311Z","updated_at":"2026-01-18T03:02:12.081Z","avatar_url":"https://github.com/techerfan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Panda\nPanda is a library for event-based communications via **WebSocket**.\n\n## Client Package:\n[This](https://github.com/techerfan/panda-client) is `panda-client` written in TypeScript. You can use it in your modern Web Apps along with `Panda`.\n\n### installation\n```\ngo get -u github.com/techerfan/panda\n```\n\n## How to use?\nFirst you need to create a new `App`. \nIn order to create a new App, you have this option to whether pass configuration or not. Configuration consists of:\n1. **`ServerAddress`**: It is the address to the server. The default is `:8000`.\n2. **`WebSocketPath`**: The path of Web Socket. The default is `/ws`.\n3. **`CommunicationType`**: You can choose the method of sending your data via Web Socket. The default is `JSON` and unfortunately, `XML` and `Binary` are not implemented yet.\n4. **`DoNotShowLogs`**: It is a boolean. If it is `true`, the module will not print logs and if it is `false`, The logger will work and you will be able to see logs. The default is `false`.\n5. **`LogsHeader`**: It is a `string` item. The logger will add it to the beginning of each log.\nThe default is `Panda`.\n6. **`AuthenticationHandler`**: This handler validates client's connection. If it is nil, package will consider that authentication is not needed and let the client to establish the connection. It takes a token as input and returns a boolean in order to specify whether continue or not and a time that shows when the connection should be destroyed.\n7. **`TicketTokenExpirationHandler`**: This handler decides what to do when a client's ticket is expired. If it is nil, there will be no default behavior.\n8. **`Logger`**: You can use your own logger if it follows [this](logger/logger.go) interface.\n\n⚠️ If you want to authenticate your clients by the `AuthenticationHandler`, you need to generate a **ticket** by yourself and add it to the WebSocket URL as a query (e.g. http://localhost:8000/ws?ticket=MY_TICKET). This way, `AuthenticationHandler` validate the ticket each time a client tries to connect to server (Do not forget you need to generate ticket yourself and validate it by implementing `AuthenticationHandler`).\n\n### Initalizing \n```golang\nimport \"github.com/techerfan/panda\"\n\napp := panda.NewApp(panda.Config{\n  ServerAddress: \":8080\",\n  WebSocketPath: \"/ws\",\n  CommunicationType: panda.JSON,\n  NotShowLogs: flase,\n  LogsHeader: \"My App\",\n})\n\n// or you can stick to the defaults and simply do this:\n\napp := panda.NewApp()\n```\n\n## New Connection\n\nPanda lets you know, by the `NewConnection` method, whenever a client connects to the server:\n\n```golang\napp.NewConnection(func(client *panda.Client) {\n  // handle the client here...\n})\n```\n\n### Client Methods\n1. `OnMessage`: Listens to the messages which client sends to the server:\n```golang\nclient.OnMessage(func (msg string) {\n  // do whatever you want with the message...\n})\n```\n2. `On`: Listens to the messages that are exchanged over a specified channel. You can decide whether send them to the clients or do something else:\n```golang\nclient.On(\"chat_message\", func(msg string) {\n\t// do sth with the message...\n})\n```\n4. `Send`: To Send a message to the client: \n```golang\nclient.Send(\"your message\")\n``` \n5. `Publish`: To publish a message over a specified channel:\n```golang\nclient.Publish(\"channel_name\", \"your message\")\n```\n6. `GetTicket`: Each client is authenticated via a ticket. You can get this ticket by this method:\n```golang\nvar ticket string\nticket = client.GetTicket()\n```\n7. `Destroy`: To destroy a client's connection.\n```golang\nerr := client.Destroy()\n```\n8. `GetClientID`: To get the client's ID.\n```golang\nvar ClientID string = client.GetClientID()\n```\n9. `Context`: To get the context of the client.\n```golang\nctx := client.Context()\n```\n\n\n## License \nLicensed under the [MIT License](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecherfan%2Fpanda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecherfan%2Fpanda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecherfan%2Fpanda/lists"}