{"id":37194263,"url":"https://github.com/hwsc-org/hwsc-document-svc","last_synced_at":"2026-01-14T22:34:52.544Z","repository":{"id":97441742,"uuid":"155598379","full_name":"hwsc-org/hwsc-document-svc","owner":"hwsc-org","description":" Provides services to hwsc-app-gateway-svc for CRUD of documents and file metadata in MongoDB","archived":true,"fork":false,"pushed_at":"2019-05-17T08:12:56.000Z","size":365,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T16:47:04.024Z","etag":null,"topics":["grpc","hwsc"],"latest_commit_sha":null,"homepage":"","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/hwsc-org.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":"2018-10-31T17:33:04.000Z","updated_at":"2023-01-28T15:30:36.000Z","dependencies_parsed_at":"2023-03-13T16:13:48.697Z","dependency_job_id":null,"html_url":"https://github.com/hwsc-org/hwsc-document-svc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hwsc-org/hwsc-document-svc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwsc-org%2Fhwsc-document-svc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwsc-org%2Fhwsc-document-svc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwsc-org%2Fhwsc-document-svc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwsc-org%2Fhwsc-document-svc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hwsc-org","download_url":"https://codeload.github.com/hwsc-org/hwsc-document-svc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwsc-org%2Fhwsc-document-svc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["grpc","hwsc"],"created_at":"2026-01-14T22:34:51.797Z","updated_at":"2026-01-14T22:34:52.522Z","avatar_url":"https://github.com/hwsc-org.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hwsc-document-svc\n\n## Purpose\n Provides services to hwsc-app-gateway-svc for CRUD document, and indexing file metadata in MongoDB and ElasticSearch.\n\n## Contract\nThe proto file and compiled proto buffers are located in [hwsc-api-blocks](https://github.com/hwsc-org/hwsc-api-blocks/tree/master/protobuf/hwsc-document-svc/document) and [hwsc-api-blocks lib](https://github.com/hwsc-org/hwsc-api-blocks/tree/master/protobuf/lib).\n### GetStatus\n- Gets the current status of the service.\n### CreateDocument\n- Creates a document in MongoDB.\n- Returns the Document.\n### ListUserDocumentCollection\n- Retrieves all the MongoDB documents for a specific user with the given UUID.\n- Returns a collection of Documents.\n### UpdateDocument\n- (completely) Updates a MongoDB document using DUID and UUID.\n- Returns the updated Document.\n### DeleteDocument\n- Deletes a MongoDB document using DUID.\n- Returns the deleted Document.\n### AddFileMetadata\n- Adds a new FileMetadata in a MongoDB document using a given url, DUID.\n- Returns the updated Document.\n### DeleteFileMetadata\n- Deletes a FileMetadata in a MongoDB document using a given FUID, DUID.\n- Returns the updated Document.\n### ListDistinctFieldValues\n- Retrieves all the unique fields values required for the front-end drop-down filter.\n- Returns the QueryTransaction\n### QueryDocument\n- Queries the MongoDB server with the given query parameters.\n- Returns a collection of Documents.\n\n## Prerequisites\n- GoLang version [go 1.12](https://golang.org/dl/)\n- GoLang Modules [go mod](https://github.com/golang/go/wiki/Modules)\n- Go Source Code Linter [golint](https://github.com/golang/lint)\n- mongo-go-driver beta [1.0.0-rc1](https://github.com/mongodb/mongo-go-driver)\n- Docker\n- [Optional] If a new proto file and compiled proto buffer exists in [hwsc-api-blocks](https://github.com/hwsc-org/hwsc-api-blocks/tree/master/protobuf/hwsc-document-svc/document), update dependency `$ go get -u \u003cpackage name\u003e`\n\n## How to Run without Docker Container\n1. Refer to [hwsc-dev-ops](https://github.com/hwsc-org/hwsc-dev-ops) to run DB locally\n2. Grab prod/dev/test config file from Slack\n3. Run main `$ go run main.go`\n\n## How to Run with Docker Container\n1. Refer to [hwsc-dev-ops](https://github.com/hwsc-org/hwsc-dev-ops) to run DB locally\n2. `$ generate_container.sh`\n3. Find your image `$ docker images`\n4. Acquire `env.list` configuration\n5. `$ docker run --env-file ./env.list -it -p 50051:50051 \u003cimagename\u003e`\n6. Optional: run `$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \u003ccontainer id\u003e` to find the proper address, and update `env.list`\n\n## How to Run Unit Test\n1. Place DB migration source codes to be tested in `test_fixtures/mongodb/`\n2. `$ cd service`\n3. The unit test will programmatically run the test container and DB migration as required\n4. For command-line summary, `$ go test -cover -v -failfast -race`\n5. For comprehensive summary, `$ bash unit_test.sh`\n6. If applicable, copy and push the new DB migration source codes in [hwsc-dev-ops](https://github.com/hwsc-org/hwsc-dev-ops) under `test` for integration testing\n\n## How to Run Integration Test\n- Refer to [hwsc-dev-ops](https://github.com/hwsc-org/hwsc-dev-ops) for running integration test\n- Ensure the service is tested using the built container in DockerHub\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwsc-org%2Fhwsc-document-svc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhwsc-org%2Fhwsc-document-svc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwsc-org%2Fhwsc-document-svc/lists"}