{"id":29091101,"url":"https://github.com/fclairamb/lib-client-document-storage-go","last_synced_at":"2025-06-28T06:05:33.315Z","repository":{"id":299689253,"uuid":"1003853651","full_name":"fclairamb/lib-client-document-storage-go","owner":"fclairamb","description":"Go client library for Stonal document storage API","archived":false,"fork":false,"pushed_at":"2025-06-17T19:21:07.000Z","size":7,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T20:27:53.234Z","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/fclairamb.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,"zenodo":null}},"created_at":"2025-06-17T19:10:41.000Z","updated_at":"2025-06-17T19:21:11.000Z","dependencies_parsed_at":"2025-06-17T20:38:33.999Z","dependency_job_id":null,"html_url":"https://github.com/fclairamb/lib-client-document-storage-go","commit_stats":null,"previous_names":["fclairamb/lib-client-document-storage-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fclairamb/lib-client-document-storage-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Flib-client-document-storage-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Flib-client-document-storage-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Flib-client-document-storage-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Flib-client-document-storage-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fclairamb","download_url":"https://codeload.github.com/fclairamb/lib-client-document-storage-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Flib-client-document-storage-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262382726,"owners_count":23302295,"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":"2025-06-28T06:05:32.350Z","updated_at":"2025-06-28T06:05:33.308Z","avatar_url":"https://github.com/fclairamb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib-client-document-storage-go\n\nGo client library for Stonal document storage API.\n\n## Overview\n\nThis library provides a Go client for the Stonal document storage API, allowing you to upload files with manifests to the document storage service.\n\n## Installation\n\n```bash\ngo get github.com/stonal-tech/lib-client-document-storage-go/stonaldoc\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log/slog\"\n    \"net/http\"\n    \"os\"\n    \n    \"github.com/stonal-tech/lib-client-document-storage-go/stonaldoc\"\n    \"github.com/stonal-tech/lib-httpclient-go/stonalhttpclient\"\n)\n\nfunc main() {\n    logger := slog.New(slog.NewTextHandler(os.Stdout, nil))\n    httpClient := stonalhttpclient.New(http.DefaultClient)\n    \n    // Implement your authenticator\n    auth := \u0026MyAuthenticator{}\n    \n    client := stonaldoc.New(logger, httpClient, auth)\n    \n    org := \u0026stonaldoc.OrgContext{\n        Env:     \"dev\",\n        Stack:   \"stack1\",\n        OrgCode: \"org123\",\n    }\n    \n    manifest := \u0026stonaldoc.FileManifest{\n        Asset: \u0026stonaldoc.Asset{\n            ExternalIDs: map[string]string{\n                \"id1\": \"value1\",\n            },\n        },\n    }\n    \n    file, err := os.Open(\"document.pdf\")\n    if err != nil {\n        panic(err)\n    }\n    \n    response, err := client.Upload(context.Background(), org, manifest, file, \"document.pdf\")\n    if err != nil {\n        panic(err)\n    }\n    \n    logger.Info(\"Upload successful\", \"documentId\", response.DocumentID)\n}\n\ntype MyAuthenticator struct{}\n\nfunc (a *MyAuthenticator) GetKeycloakAuthToken() (*stonaldoc.JWT, error) {\n    // Implement your authentication logic here\n    return \u0026stonaldoc.JWT{\n        AccessToken: \"your-token\",\n    }, nil\n}\n```\n\n## Types\n\n### OrgContext\n\nRepresents the organization context containing environment, stack, and organization code.\n\n### FileManifest\n\nFlexible structure that can handle different JSON formats for file manifests, including asset information, documentation metadata, and folder templates.\n\n### UploadResponse\n\nResponse from the upload API containing the document ID and any duplicate document IDs.\n\n## License\n\nThis project is proprietary to Stonal Technologies.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffclairamb%2Flib-client-document-storage-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffclairamb%2Flib-client-document-storage-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffclairamb%2Flib-client-document-storage-go/lists"}