{"id":20476859,"url":"https://github.com/oleiade/atelier","last_synced_at":"2026-02-04T15:01:50.980Z","repository":{"id":215410172,"uuid":"738877549","full_name":"oleiade/atelier","owner":"oleiade","description":"A collection of Go algorithms, data structures, APIs and helpers to resort to when in need","archived":false,"fork":false,"pushed_at":"2024-06-16T09:11:12.000Z","size":159,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T22:51:48.081Z","etag":null,"topics":["algorithms","data-structures","golang","helpers"],"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/oleiade.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":"2024-01-04T08:54:08.000Z","updated_at":"2024-06-16T09:10:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"dcef5c84-e040-4b62-afc3-1eb870ae148d","html_url":"https://github.com/oleiade/atelier","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":"0.16666666666666663","last_synced_commit":"7202ee5ef151137aebbf4020cc017e5b837f4614"},"previous_names":["oleiade/atelier"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fatelier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fatelier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fatelier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleiade%2Fatelier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleiade","download_url":"https://codeload.github.com/oleiade/atelier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125643,"owners_count":21051766,"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":["algorithms","data-structures","golang","helpers"],"created_at":"2024-11-15T15:24:08.760Z","updated_at":"2026-02-04T15:01:45.941Z","avatar_url":"https://github.com/oleiade.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"logo.png\" alt=\"atelier logo\"/\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eGolang algorithms, data structures, APIs and helpers to resort to when in need\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"http://github.com/oleiade/atelier/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/oleiade/atelier.svg\" alt=\"release\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/oleiade/atelier/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/oleiade/atelier/actions/workflows/build.yml/badge.svg\" alt=\"Build status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nAtelier is a Go library providing a set of algorithms, data structures, APIs and helpers to resort to when in need.\n\nIt is essentially my personal library of Go code, in a single place, easily accessible. Types, tools, helpers, that I use on a recurrent basis, and that I don't want to rewrite every time I need them.\n\n- [Usage](#usage)\n- [Content](#content)\n  - [Data structures](#data-structures)\n    - [Trie](#trie)\n  - [Tooling](#tooling)\n    - [Debugging](#debugging)\n      - [MapAddressToWord](#mapaddresstoword)\n\n## Usage\n\n```bash\ngo get github.com/oleiade/atelier\n```\n\n## Content\n\n### Data structures\n\n#### [Trie](./trie.go)\n\nThe Trie is a versatile tree-like structure optimized for **storing and searching strings**. Tries are ideal for operations such as autocomplete, prefix lookup, and spell checking, as they provide efficient means of storing and retrieving words based on their prefixes. This Trie implementation supports insertion, search, autocomplete, and also offers specialized methods to find words that start or end with specific substrings, making it suitable for use cases that require fast and flexible string searching capabilities.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/oleiade/atelier\"\n)\n\nfunc main() {\n    trie := atelier.NewTrie()\n\n    wordsToInsert := []string{\"apple\", \"app\", \"application\", \"banana\", \"band\", \"bandana\"}\n    for _, word := range wordsToInsert {\n        trie.Insert(word)\n    }\n    fmt.Println(\"Words inserted into the Trie.\")\n\n    // Searching for a word\n    searchWord := \"apple\"\n    if trie.Search(searchWord) {\n        fmt.Println(\"Word found:\", searchWord)\n    } else {\n        fmt.Println(\"Word not found:\", searchWord)\n    }\n\n    // Using Autocomplete\n    prefix := \"app\"\n    suggestions := trie.Autocomplete(prefix)\n    fmt.Println(\"Autocomplete suggestions for\", prefix, \":\", suggestions)\n\n    // Finding words that start with a specific prefix\n    prefix = \"ba\"\n    wordsWithPrefix := trie.StartsWith(prefix)\n    fmt.Println(\"Words starting with\", prefix, \":\", wordsWithPrefix)\n\n    // Finding words that end with a specific suffix\n    suffix := \"ana\"\n    wordsWithSuffix := trie.EndsWith(suffix)\n    fmt.Println(\"Words ending with\", suffix, \":\", wordsWithSuffix)\n}\n```\n\n### Tooling\n\n#### Time\n\n##### [Time points](./time.go)\n\n* `BeginningOfTime` constant: Represents the beginning of time, i.e., the Unix epoch.\n* `DaysInAWeek`, `DaysInAMonth`, `DaysInAYear` constants: Constants representing the number of days in a week, month, and year, respectively.\n* `OneDayBefore(time.Time) time.Time`: Returns the time one day before the given time.\n* `OneWeekBefore(time.Time) time.Time`: Returns the time one week before the given time.\n* `OneMonthBefore(time.Time) time.Time`: Returns the time one month before the given time.\n* `OneYearBefore(time.Time) time.Time`: Returns the time one year before the given time.\n\n##### [ISO8601 Time](./time.go)\n\nProvides an implementation of the `ISO8601Time` format representation, which is a standardized way of representing dates and times.\nThis type supports JSON unmarshalling, and proves especially useful to load time from JSON APIs providing dates in ISO8601 format.\n\n##### [Period Parsing](./time.go)\n\n`ParseTimePeriod(string) (time.Duration, error)` parses a string representation of a period (\"1 day\", \"25s\", \"3 years\", etc...) and returns the corresponding `time.Duration`.\n\nThe period string should be in the format of a number followed by a unit, such as \"1d\" for 1 day or \"2w\" for 2 weeks.\nValid units are \"d\" (day), \"w\" (week), \"m\" (month), and \"y\" (year).\nThe function returns an error if the period string is empty, contains an invalid number or unit, or has an\ninvalid combination of number and unit.\n\n#### Debugging\n\n##### [MapAddressToWord](./debug.go)\n\nProvides a way to **map the memory address of a given pointer to a human-readable word**. This utility is particularly useful in debugging scenarios, where tracking and identifying pointers by their raw addresses can be cumbersome. By leveraging a hash function, this method calculates an index into a predefined WordList, transforming a numeric memory address into a more memorable and recognizable word. This approach simplifies the process of monitoring and distinguishing different pointer variables during debugging, making it easier to follow their behavior and interactions within the program.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleiade%2Fatelier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleiade%2Fatelier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleiade%2Fatelier/lists"}