{"id":49337145,"url":"https://github.com/pararang/gostein","last_synced_at":"2026-04-27T01:04:38.313Z","repository":{"id":40335110,"uuid":"502562105","full_name":"pararang/gostein","owner":"pararang","description":"Stein API Library for Golang ","archived":false,"fork":false,"pushed_at":"2025-09-02T15:47:44.000Z","size":82,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T00:37:18.053Z","etag":null,"topics":["api-client","api-client-go","api-wrappers","go","golang","golang-library","golang-package","google-sheets","hacktoberfest","spreadsheets","stein"],"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/pararang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-06-12T08:40:24.000Z","updated_at":"2024-12-25T12:54:27.000Z","dependencies_parsed_at":"2024-05-01T08:49:54.252Z","dependency_job_id":"f8fbe735-f318-428a-86f3-85ed00aabf2a","html_url":"https://github.com/pararang/gostein","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pararang/gostein","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pararang%2Fgostein","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pararang%2Fgostein/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pararang%2Fgostein/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pararang%2Fgostein/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pararang","download_url":"https://codeload.github.com/pararang/gostein/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pararang%2Fgostein/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32318419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: 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":["api-client","api-client-go","api-wrappers","go","golang","golang-library","golang-package","google-sheets","hacktoberfest","spreadsheets","stein"],"created_at":"2026-04-27T01:04:37.022Z","updated_at":"2026-04-27T01:04:38.295Z","avatar_url":"https://github.com/pararang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Coverage](https://img.shields.io/badge/Coverage-82.0%25-brightgreen)\n# gostein\n\n[Stein](https://steinhq.com/) API wrapper for Go.\n\n## Installation\n\n```go\ngo get github.com/pararang/gostein\n```\n\n## Usage\n### Create a new client\n```go\nimport \"github.com/pararang/gostein\"\n...\nsteinClient = gostein.New(\"http://yourstein.host/v1/storage/your-api-id\", nil, nil)\n\n// with basic auth\nsteinClient = gostein.New(\n    \"http://yourstein.host/v1/storage/your-api-id\", \n    nil, \n    \u0026gostein.BasicAuth{\n\t\tUsername: \"pararang\",\n\t\tPassword: \"pararang123\",\n\t})\n```\n\u003e If HTTP Client is not provided (nil) on the second parameter, `DefaultClient` from http golang stdlib will be used.\n\n### Read\n#### Get data\n```go\n...\n// Get all data\ndata, err := steinClient.Get(\"sheet1\", gostein.GetParams{})\n\n// Get with offset and limit\ndata, err := steinClient.Get(\"sheet1\", gostein.GetParams{Offset: 0, Limit: 10})\n...\n```\nThe `data` will be in type of `[]map[string]interface{}`. To convert the data to specific struct, I recomended using [maptostructure package](https://github.com/mitchellh/mapstructure).\n\n#### Search data\nLook up rows in a sheet by a specific value on column(s).\n```go\ndata, err := steinClient.Get(\"sheet1\", gostein.GetParams{\n    Limit: 10,\n    Search: map[string]string{\n            \"column_1\": \"value_column_1\",\n            \"column_2\": \"value_column_2\",\n        }\n    })\n...\n```\n\n### Add\n#### Add single data\n```go\n...\nresp, err = steinClient.Add(\"sheet1\",\n    map[string]interface{}{\n        \"column_1\": \"value_1\",\n        \"column_2\": \"value_2\",\n    })\n// handle err and do something with resp\n...\n```\n\n#### Add bulk/multiple data\n```go\nresp, err := s.Add(\"gostein\", \n    map[string]interface{}{\n        \"column_1\": \"value_1-a\",\n        \"column_2\": \"value_2-a\",\n    }, \n    map[string]interface{}{\n        \"column_1\": \"value_1-b\",\n        \"column_2\": \"value_2-b\",\n    })\n\n// with better code readability, utilize the variadic function definition\nrows := []map[string]interface{}{\n    {\"column_1\": \"value_1-a\", \"column_2\": \"value_2-a\"},\n    {\"column_1\": \"value_1-b\", \"column_2\": \"value_2-b\"},\n}\n\nresp, err = steinClient.Add(\"sheet1\", rows...)\n// handle err then do something with resp\n...\n```\n### Update\nThe update operation return string that indicate ranges of the sheet that was updated. Example: `Sheet1!A3:B3`.\n#### Update single row\n`Limit 1` indicate to update only the first row that match the `Condition`.\n```go\n...\nresp, err := sc.Update(\"Sheet1\", UpdateParams{\n\t\t\tCondition: map[string]string{\n\t\t\t\t\"column_1\": \"if_has_this_value\",\n\t\t\t},\n\t\t\tSet: map[string]string{\n\t\t\t\t\"column_2\": \"then_update_this_colum_value\",\n\t\t\t},\n\t\t\tLimit: 1,\n\t\t})\n// handle err and do something with resp\n...\n```\n#### Update with multiple conditions\nAll `Condition` will be translated to `AND` condition.\n```go\n...\nresp, err := sc.Update(\"Sheet1\", UpdateParams{\n\t\t\tCondition: map[string]string{\n\t\t\t\t\"column_1\": \"if_has_this_value\",\n\t\t\t\t\"column_3\": \"and_if_has_this_value\",\n\t\t\t},\n\t\t\tSet: map[string]string{\n\t\t\t\t\"column_2\": \"then_update_this_colum_value\",\n\t\t\t},\n\t\t})\n// handle err and do something with resp\n...\n```\n\u003e :warning: **If `Limit` is not set, all rows those match the `Condition` will be updated.**\n### Delete\nThe delete operation return int64 that indicate the number of rows that was deleted.\n#### Delete single row\n`Limit 1` indicate to delete only the first row that match the `Condition`.\n```go\n...\nresp, err := sc.Delete(\"Sheet1\", DeleteParams{\n\t\t\tCondition: map[string]string{\n\t\t\t\t\"column_1\": \"if_has_this_value\",\n\t\t\t},\n\t\t\tLimit: 1,\n\t\t})\n// handle err and do something with resp\n...\n```\n#### Delete with multiple conditions\nAll `Condition` will be translated to `AND` condition.\n```go\n...\nresp, err := sc.Delete(\"Sheet1\", DeleteParams{\n\t\t\tCondition: map[string]string{\n\t\t\t\t\"column_1\": \"if_has_this_value\",\n\t\t\t\t\"column_3\": \"and_if_has_this_value\",\n\t\t\t},\n\t\t})\n// handle err and do something with resp\n...\n```\n\u003e :warning: **If `Limit` is not set, all rows those match the `Condition` will be deleted.**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpararang%2Fgostein","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpararang%2Fgostein","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpararang%2Fgostein/lists"}