{"id":22161113,"url":"https://github.com/mr-destructive/gofx","last_synced_at":"2025-03-24T15:24:10.317Z","repository":{"id":208475007,"uuid":"720393383","full_name":"Mr-Destructive/gofx","owner":"Mr-Destructive","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-23T16:03:34.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T20:37:16.551Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mr-Destructive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-18T10:52:43.000Z","updated_at":"2023-11-18T10:53:24.000Z","dependencies_parsed_at":"2023-11-21T17:46:12.949Z","dependency_job_id":"ea02b515-1c7e-4245-ae49-e78ed65b53a2","html_url":"https://github.com/Mr-Destructive/gofx","commit_stats":null,"previous_names":["mr-destructive/gofx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fgofx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fgofx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fgofx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fgofx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mr-Destructive","download_url":"https://codeload.github.com/Mr-Destructive/gofx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245295560,"owners_count":20592059,"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-12-02T04:13:13.327Z","updated_at":"2025-03-24T15:24:10.288Z","avatar_url":"https://github.com/Mr-Destructive.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Gofx\n\nA simple go library for utility functions related to map access.\n\n## Features\n\n- Map\n    - Get value for a given key\n    - Set the value for a given key\n    - Get or Set value for a given key\n    - Delete the pair for the given key\n    - Get all keys\n    - Get all values\n    - Get the length of the map\n\n\n## Example\n\n```go\nmymap := gofx.Map[string, int]{\n    \"S\": 2,\n    \"M\": 4,\n    \"L\": 6,\n}\n// Get the value associated with a key\nvalue, exists := mymap.Get(\"M\")\nif exists {\n    fmt.Printf(\"M value is: %d\\n\", value)\n}\n```\n\n```go\n// Get or set a value with a default if the key doesn't exist\nkey := \"XL\"\n// when the key is not present, the default value is based on the data type\nvalue, exists = n.Get(key)\nfmt.Printf(\"%s value is: %d\\n\", key, value)\n```\n\n```go\n// Set a new key-value pair\nn.Set(\"XS\", 0)\n\nvalue, exists = n.GetSet(\"XL\", 8)\nfmt.Printf(\"%s value is: %d\\n\", key, value)\n```\n\n```go\n// Delete a key-value pair\ndeletedValue, deleted := n.Delete(key)\nif deleted {\n    fmt.Printf(\"%s value deleted with value: %d\", key, deletedValue)\n}\n```\n\n```go\n// Retrieve all keys and values\nkeys := n.Keys()\nfmt.Println(\"Keys:\", keys)\nvalues := n.Values()\nfmt.Println(\"Values:\", values)\n\n// Get the length of the nap\nlength := n.Len()\nfmt.Println(\"Map Length:\", length)\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-destructive%2Fgofx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-destructive%2Fgofx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-destructive%2Fgofx/lists"}