{"id":13600720,"url":"https://github.com/luisvinicius167/godux","last_synced_at":"2025-10-10T03:14:33.750Z","repository":{"id":57494952,"uuid":"60049421","full_name":"luisvinicius167/godux","owner":"luisvinicius167","description":"State Management for Go Backend application inspired in Redux. ","archived":false,"fork":false,"pushed_at":"2020-10-04T12:49:00.000Z","size":58,"stargazers_count":258,"open_issues_count":5,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T04:12:51.008Z","etag":null,"topics":["backend-applications","golang","redux","state"],"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/luisvinicius167.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}},"created_at":"2016-05-31T01:34:33.000Z","updated_at":"2024-12-20T09:04:56.000Z","dependencies_parsed_at":"2022-08-28T15:10:58.448Z","dependency_job_id":null,"html_url":"https://github.com/luisvinicius167/godux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luisvinicius167/godux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvinicius167%2Fgodux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvinicius167%2Fgodux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvinicius167%2Fgodux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvinicius167%2Fgodux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisvinicius167","download_url":"https://codeload.github.com/luisvinicius167/godux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisvinicius167%2Fgodux/sbom","scorecard":{"id":603682,"data":{"date":"2025-08-11","repo":{"name":"github.com/luisvinicius167/godux","commit":"70bcb3c517481006f12a3a4f703d345784541e78"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/25 approved changesets -- score normalized to 2","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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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 'master'"],"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":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 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":10,"reason":"0 existing vulnerabilities detected","details":null,"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-21T01:06:18.256Z","repository_id":57494952,"created_at":"2025-08-21T01:06:18.256Z","updated_at":"2025-08-21T01:06:18.256Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002553,"owners_count":26083417,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":["backend-applications","golang","redux","state"],"created_at":"2024-08-01T18:00:47.208Z","updated_at":"2025-10-10T03:14:33.702Z","avatar_url":"https://github.com/luisvinicius167.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# godux \u003cbr/\u003e\n\n[![Join the chat at https://gitter.im/luisvinicius167/godux](https://badges.gitter.im/luisvinicius167/godux.svg)](https://gitter.im/luisvinicius167/godux?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Go Report Card](https://goreportcard.com/badge/github.com/luisvinicius167/godux)](https://goreportcard.com/report/github.com/luisvinicius167/godux)\n\u003e State Management for Go Backend applications inspired by Redux.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/godux_.png\" alt=\"Godux\"\u003e\n\u003c/p\u003e\n\n\u003cpre align=\"center\"\u003e\n╔═════════╗       ╔══════════╗       ╔═══════════╗       ╔═════════════════╗\n║ Action  ║──────\u003e║ Reducer  ║ ────\u003e ║   Store   ║ ────\u003e ║   Application   ║\n╚═════════╝       ╚══════════╝       ╚═══════════╝       ╚═════════════════╝\n     ^                                                            │\n     └────────────────────────────────────────────────────────────┘\n\n\u003c/pre\u003e\n\n### Install\n* Go: ``` go get github.com/luisvinicius167/godux ```\n\n### Data Flow\n**godux** gives go unidirectional data flow:\n\n* The Action returns a small map with specific directions that are dispatched to a Reducer.\n* The Reducer is a pure function (pure functions don't change original arguments) if relevant to it returns a new Value.\n* The Value becomes the new State of the Store.\n\n### Principles:\n* Global application state is held in the Store, as a single map.\n* State is ready-only (only *change* it only by *replacing* it with the Reducer).\n* Changes are made with pure functions - Actions/Reducers that do not change the actual object but make a changed copy.\n\n### Store:\nA Store is basically a container that holds your application state.\n\n```go\n    store := godux.NewStore()\n\tstore.Setstate(\"count\", 1)\n    store.Setstate(\"Title\", \"I like godux!\")\n```\n\n#### Action\nActions are just pure functions which pass on their inputs when they're dispatched. Actions are stored on the `godux` map as `godux.Action`. \n\n```go\n    increment := func(number int) godux.Action {\n\t\treturn godux.Action{\n\t\t\tType:  \"INCREMENT\",\n\t\t\tValue: number,\n\t\t}\n\t}\n```\n### Reducers\nAs in Redux: \n\u003e \"Actions describe the fact that something happened, but don’t specify how the application’s state changes in response. This is the job of a reducer\". \n\nReducers are *pure* functions that take in actions and the state of the store as inputs and leave them all as they came in (aka. pure)-- especially the original state of the store must not be modified (it's accessed by `store.GetState`)).\n\n```go\n    // reducer function\n\treducer := func(action godux.Action) interface{} {\n\t\tswitch action.Type {\n\t\tcase \"INCREMENT\":\n\t\t\treturn store.GetState(\"count\").(int) + action.Value.(int)\n\t\tcase \"DECREMENT\":\n\t\t\treturn action.Value.(int) - store.GetState(\"count\").(int)\n\t\tdefault:\n\t\t\treturn store.GetAllState()\n\t\t}\n\t}\n\t// Add your reducer function to return new values basend on your state\n\tstore.Reducer(reducer)\n```\n#### Dispatch\nDispatching an action is very easy.\n```go\n    // Receive new value\n\tnewCount := store.Dispatch(increment(1)) // return 2\n```\n\n### API Reference\n\n* #### Store:\n  * ` godux.newStore() `: Create a single store with the state of your application (should only be used once).\n  * ` godux.SetState(name string, value interface{}) `: Sets the state of the store.\n  * ` godux.GetState(name string) `: Return a state's value.\n  * ` godux.GetAllState() `: Return the whole state as a map.\n\n* ##### Reducer:\n  * ``` store.Reducer(func(action godux.Action)) ```: Adding a reducer function to your Store.\n\n* ##### Dispatch:\n  * ``` store.Dispatch(action godux.Action) ```: Dispatching an action to your Reducer.\n\n* #### Action:\n  * ``` godux.Action( Type string, Value interface{}) ```: Adding an easily available Action.\n\n### License\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisvinicius167%2Fgodux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisvinicius167%2Fgodux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisvinicius167%2Fgodux/lists"}