{"id":19270617,"url":"https://github.com/sphireinc/mantis","last_synced_at":"2025-04-21T20:33:46.836Z","repository":{"id":43373375,"uuid":"183719702","full_name":"sphireinc/Mantis","owner":"sphireinc","description":"Sphire Mantis is a broadly featured Go helper library with standalone packages","archived":false,"fork":false,"pushed_at":"2025-03-13T00:29:07.000Z","size":2913,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T22:04:22.103Z","etag":null,"topics":["database","errors","helper","helper-functions","interface","logging"],"latest_commit_sha":null,"homepage":"https://sphireinc.github.io/Mantis/","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/sphireinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-27T02:39:52.000Z","updated_at":"2024-07-23T19:28:42.000Z","dependencies_parsed_at":"2023-02-17T03:16:07.633Z","dependency_job_id":"4d4888df-a186-46fd-80c4-266da7438307","html_url":"https://github.com/sphireinc/Mantis","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2FMantis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2FMantis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2FMantis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphireinc%2FMantis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sphireinc","download_url":"https://codeload.github.com/sphireinc/Mantis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250128509,"owners_count":21379526,"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":["database","errors","helper","helper-functions","interface","logging"],"created_at":"2024-11-09T20:26:03.681Z","updated_at":"2025-04-21T20:33:46.437Z","avatar_url":"https://github.com/sphireinc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release Version](https://img.shields.io/github/v/release/sphireinc/mantis)](https://github.com/sphireinc/Mantis/releases/latest)\n[![Release Date](https://img.shields.io/github/release-date/sphireinc/mantis)](https://github.com/sphireinc/Mantis/releases/latest)\n[![Build Status](https://github.com/sphireinc/Mantis/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/sphireinc/Mantis/actions/workflows/build-and-test.yml)\n[![Go Version](https://img.shields.io/github/go-mod/go-version/sphireinc/mantis)](https://github.com/sphireinc/Mantis/releases/latest)\n[![License](https://img.shields.io/github/license/sphireinc/mantis)](https://github.com/sphireinc/Mantis/releases/latest)\n[![Codacy and CodeQL](https://github.com/sphireinc/Mantis/actions/workflows/analyze.yml/badge.svg?branch=master)](https://github.com/sphireinc/Mantis/actions/workflows/codeql-analysis.yml)\n[![Documentation](https://img.shields.io/badge/GitHub_Pages-Ready-blue)](https://sphireinc.github.io/Mantis/)\n\n\u003cp\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/sphireinc/Mantis/master/_logo/mantis_logo.png\" alt=\"Sphire Mantis Logo\"/\u003e\n\u003c/p\u003e\n\n\u003e A broadly featured Go helper library with standalone packages\n\n\u003cp\u003e\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/byte\"\u003e\u003cimg src=\"https://img.shields.io/badge/Byte-brightgreen\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/cache\"\u003e\u003cimg src=\"https://img.shields.io/badge/Cache-blue\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/data\"\u003e\u003cimg src=\"https://img.shields.io/badge/Data-orangered\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/database\"\u003e\u003cimg src=\"https://img.shields.io/badge/Database-violet\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/date\"\u003e\u003cimg src=\"https://img.shields.io/badge/Date-informational\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/encoding\"\u003e\u003cimg src=\"https://img.shields.io/badge/Encoding-brightgreen\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/encryption\"\u003e\u003cimg src=\"https://img.shields.io/badge/Encryption-orangered\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/helper\"\u003e\u003cimg src=\"https://img.shields.io/badge/Helper-important\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/http\"\u003e\u003cimg src=\"https://img.shields.io/badge/HTTP-critical\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/log\"\u003e\u003cimg src=\"https://img.shields.io/badge/Log-blue\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/uuid\"\u003e\u003cimg src=\"https://img.shields.io/badge/UUID-lightgrey\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n  \u003ca target=\"_blank\" href=\"https://github.com/sphireinc/Mantis/tree/master/validation\"\u003e\u003cimg src=\"https://img.shields.io/badge/Validation-critical\" alt=\"\"/\u003e\u003c/a\u003e\u0026nbsp;\n\u003c/p\u003e\n\n\n# Mantis\n\nMantis is a collection of helper libraries written in order to reduce\nthe need to code common patterns and functionality. Subpackages are developed, when possible, \nto have zero side effects on the parent application - helper functions are (or in some cases will be)\nwritten in such a manner that they accept, act on, and return data.\n\nMantis, much like its namesake ([Jet's Go-Mantis](https://github.com/jet/go-mantis) library), is the\n\"standard library\" for Sphire's Golang codebase, used heavily in projects like Sphire Core and Sphire Codex. \n\n# API Docs\n\n[Mantis API docs are hosted on github.io](https://sphireinc.github.io/Mantis/)\n\n# Usage\n\nRunning `go get github.com/sphireinc/mantis` will fetch the mantis project within your Go project.\n\nImports work at a package level. If you'd like to use the date package, please do:\n\n```go\npackage main \n\nimport (\n\tmantisDate `github.com/sphireinc/mantis/date`\n)\n\nfunc main(){ \n\tdatem := mantisDate.CurrentTime() // return type: mantisDate.Date\n\tfmt.Println(datem.String())\n}\n```\n\n```bash\n$ go run main.go\n{\n  \"year\": 2009,\n  \"month\": 11,\n  \"day\": 10,\n  \"hour\": 23,\n  \"minute\": 0,\n  \"second\": 0,\n  \"nanosecond\": 0,\n  \"unix\": 1257894000,\n  \"week_day\": 2,\n  \"year_day\": 314\n}\n```\n\n# Tests\n\nEach package can be tested independently via `go test`, or all packages can be tested from \nthe root via `go test ./...`\n\n# Local Development\n\nYou should ideally install these packages:\n\n```bash\ngo install golang.org/x/lint/golint@latest\ngo install github.com/securego/gosec/v2/cmd/gosec@latest\ngo install golang.org/x/tools/cmd/goimports@latest\ngo install honnef.co/go/tools/cmd/staticcheck@latest\ngo install github.com/fzipp/gocyclo/cmd/gocyclo@latest\n```\n\nThen you should run these commands, ideally as a pre-commit check:\n\n```bash\ngo fmt\ngo vet\ngolint package_name\nstaticcheck\ngoimports -v -e -w package_name\n```\n\n# Go Cyclo\n\nMantis makes use of `gocyclo` in order to ensure cyclomatic complexity remains low. All functions *should* \nstandardize below a 10, following Tom McCabes categorizations from his \"Software Quality Metrics \nto Identify Risk\" presentation for the Department of Homeland Security:\n\n* 1 - 10 Simple procedure, little risk\n* 11 - 20 More complex, moderate risk\n* 21 - 50 Complex, high risk\n* \\\u003e 50 Untestable code, very high risk\n\n# GoLoC\n\nUsing \u003chttps://github.com/hhatto/gocloc\u003e\n\n| Language     | files | blank  | comment | code    |\n|--------------|-------|--------|---------|---------|\n| Go           | 615   | 20,351 | 22,051  | 105,753 |\n| Markdown     | 61    | 1,610  | 0       | 6,389   |\n| Plain Text   | 7     | 160    | 0       | 930     |\n| Makefile     | 4     | 128    | 36      | 476     |\n| XML          | 6     | 0      | 0       | 299     |\n| YAML         | 18    | 49     | 15      | 269     |\n| JSON         | 5     | 0      | 0       | 199     |\n| Assembly     | 1     | 39     | 42      | 134     |\n| Bourne Shell | 3     | 12     | 4       | 74      |\n| TOML         | 3     | 29     | 1       | 73      |\n| BASH         | 2     | 4      | 7       | 33      |\n| TOTAL        | 725   | 22,382 | 22,156  | 114,629 |\n\n# Contributing\n\nPlease find our contribution guidelines within [CONTRIBUTING.md](https://github.com/sphireinc/Mantis/blob/master/CONTRIBUTING.md)\n\n# Thanks\n\nThanks to all below for their contributions, inspiration, or otherwise:\n\n* [norunners](https://github.com/norunners) for his contribution towards Mantis' Go 1.18 build update\n* \u003chttps://github.com/dec0dOS/amazing-github-template\u003e for the `.github ISSUE_TEMPLATE`\n* \u003chttps://github.com/junosuarez/CONTRIBUTING.md\u003e for the `CONTRIBUTING.md` template\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphireinc%2Fmantis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsphireinc%2Fmantis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphireinc%2Fmantis/lists"}