{"id":29880990,"url":"https://github.com/golang-common-packages/storage","last_synced_at":"2026-02-15T03:31:52.813Z","repository":{"id":57510100,"uuid":"237369073","full_name":"golang-common-packages/storage","owner":"golang-common-packages","description":"This package helps you work with all types of storage","archived":false,"fork":false,"pushed_at":"2025-04-02T11:07:02.000Z","size":330,"stargazers_count":0,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-03T19:21:37.880Z","etag":null,"topics":["database","go","golang","storage"],"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/golang-common-packages.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":"2020-01-31T05:50:52.000Z","updated_at":"2025-04-02T11:07:05.000Z","dependencies_parsed_at":"2025-04-02T11:37:02.217Z","dependency_job_id":null,"html_url":"https://github.com/golang-common-packages/storage","commit_stats":null,"previous_names":["golang-common-packages/database"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/golang-common-packages/storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-common-packages%2Fstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-common-packages%2Fstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-common-packages%2Fstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-common-packages%2Fstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golang-common-packages","download_url":"https://codeload.github.com/golang-common-packages/storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-common-packages%2Fstorage/sbom","scorecard":{"id":434363,"data":{"date":"2025-08-11","repo":{"name":"github.com/golang-common-packages/storage","commit":"6cf786e47570a00c1254d2a68d992fe7b22185c8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/14 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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.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":"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":"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":"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":"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/go.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-common-packages/storage/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-common-packages/storage/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-common-packages/storage/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-common-packages/storage/go.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:2","Warn: containerImage not pinned by hash: Dockerfile:24: pin your Docker image by updating alpine:latest to alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Warn: goCommand not pinned by hash: .github/workflows/go.yml:43","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   0 out of   1 goCommand 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":"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 18 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":0,"reason":"25 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0635","Warn: Project is vulnerable to: GO-2022-0646","Warn: Project is vulnerable to: GO-2022-1031 / GHSA-crxj-hrmp-4rwf","Warn: Project is vulnerable to: GO-2022-0968 / GHSA-gwc9-m7rh-j2ww","Warn: Project is vulnerable to: GO-2021-0356 / GHSA-8c26-wmh5-6g9v","Warn: Project is vulnerable to: GO-2024-2961","Warn: Project is vulnerable to: GO-2023-2402 / GHSA-45x7-px36-x8w8","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GO-2023-2153 / GHSA-m425-mq94-257g / GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2021-0113 / GHSA-ppp9-7jff-5vj2","Warn: Project is vulnerable to: GO-2022-1059 / GHSA-69ch-w2m2-3vjp","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"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-19T04:13:43.922Z","repository_id":57510100,"created_at":"2025-08-19T04:13:43.922Z","updated_at":"2025-08-19T04:13:43.922Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29466929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"online","status_checked_at":"2026-02-15T02:00:07.449Z","response_time":118,"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":["database","go","golang","storage"],"created_at":"2025-07-31T10:20:21.861Z","updated_at":"2026-02-15T03:31:52.807Z","avatar_url":"https://github.com/golang-common-packages.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storage\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/golang-common-packages/storage)](https://goreportcard.com/report/github.com/golang-common-packages/storage)\n[![GoDoc](https://godoc.org/github.com/golang-common-packages/storage?status.svg)](https://godoc.org/github.com/golang-common-packages/storage)\n[![License](https://img.shields.io/github/license/golang-common-packages/storage)](LICENSE)\n\nThe Storage library provides a unified interface for various storage types, including SQL, NoSQL, and File. The library uses the Abstract Factory design pattern to create different storage objects.\n\n## Installation\n\n```bash\ngo get github.com/golang-common-packages/storage\n```\n\n## Features\n\n- **SQL Relational**: Support for SQL databases through Go's `database/sql` package\n- **NoSQL Document**: Support for MongoDB\n- **NoSQL Key-Value**: Support for Redis, BigCache, and custom implementations\n- **File**: Support for Google Drive and custom implementations\n\n## Usage\n\n### Import\n\n```go\nimport \"github.com/golang-common-packages/storage\"\n```\n\n### Working with MongoDB\n\n```go\n// Initialize MongoDB client\nmongoClient := storage.New(context.Background(), storage.NOSQLDOCUMENT)(storage.MONGODB, \u0026storage.Config{\n    MongoDB: storage.MongoDB{\n        User:     \"USERNAME\",\n        Password: \"PASSWORD\",\n        Hosts:    []string{\"localhost:27017\"},\n        Options:  []string{},\n        DB:       \"DATABASE_NAME\",\n    },\n}).(storage.INoSQLDocument)\n\n// Create document\ndocuments := []interface{}{\n    map[string]interface{}{\n        \"name\": \"John Doe\",\n        \"age\":  30,\n    },\n}\nresult, err := mongoClient.Create(\"database\", \"collection\", documents)\n\n// Read document\nfilter := bson.M{\"name\": \"John Doe\"}\nresult, err := mongoClient.Read(\"database\", \"collection\", filter, 10, reflect.TypeOf(YourModel{}))\n\n// Update document\nfilter := bson.M{\"name\": \"John Doe\"}\nupdate := bson.M{\"$set\": bson.M{\"age\": 31}}\nresult, err := mongoClient.Update(\"database\", \"collection\", filter, update)\n\n// Delete document\nfilter := bson.M{\"name\": \"John Doe\"}\nresult, err := mongoClient.Delete(\"database\", \"collection\", filter)\n```\n\n### Working with Redis\n\n```go\n// Initialize Redis client\nredisClient := storage.New(context.Background(), storage.NOSQLKEYVALUE)(storage.REDIS, \u0026storage.Config{\n    Redis: storage.Redis{\n        Host:       \"localhost:6379\",\n        Password:   \"PASSWORD\",\n        DB:         0,\n        MaxRetries: 3,\n    },\n}).(storage.INoSQLKeyValue)\n\n// Store value\nerr := redisClient.Set(\"key\", \"value\", 1*time.Hour)\n\n// Get value\nvalue, err := redisClient.Get(\"key\")\n\n// Update value\nerr := redisClient.Update(\"key\", \"new-value\", 1*time.Hour)\n\n// Delete value\nerr := redisClient.Delete(\"key\")\n```\n\n### Working with Google Drive\n\n```go\n// Initialize Google Drive client\ndriveClient := storage.New(context.Background(), storage.FILE)(storage.DRIVE, \u0026storage.Config{\n    GoogleDrive: storage.GoogleDrive{\n        PoolSize:     4,\n        ByHTTPClient: false,\n        Credential:   \"credentials.json\",\n        Token:        \"token.json\",\n    },\n}).(storage.IFILE)\n\n// List files\nfiles, err := driveClient.List(100)\n\n// Create folder\nfolder, err := driveClient.CreateFolder(\"folder-name\")\n\n// Upload file\nfile, err := os.Open(\"file.txt\")\nresult, err := driveClient.Upload(\"file.txt\", file)\n\n// Download file\nresult, err := driveClient.Download(\"file-id\")\n\n// Move file\nresult, err := driveClient.Move(\"file-id\", \"old-parent-id\", \"new-parent-id\")\n\n// Delete file\nerr := driveClient.Delete([]string{\"file-id\"})\n```\n\n## Development\n\n### Requirements\n\n- Go 1.15+\n- MongoDB (for NoSQL Document)\n- Redis (for NoSQL Key-Value)\n- SQLite (for SQL Relational)\n\n### Running tests\n\n```bash\n# Run all tests\nmake test\n\n# Run short tests (skip tests requiring database connections)\nmake test-short\n\n# Run tests with coverage\nmake coverage\n```\n\n### Docker\n\n```bash\n# Build Docker image\nmake docker-build\n\n# Run Docker container\nmake docker-run\n\n# Run with Docker Compose\ndocker-compose up\n```\n\n## Contributing\n\nWe welcome contributions from the community. Please create an issue or pull request on GitHub.\n\n## License\n\nThis project is distributed under the MIT license. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolang-common-packages%2Fstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolang-common-packages%2Fstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolang-common-packages%2Fstorage/lists"}