{"id":29571863,"url":"https://github.com/oceanbase/obshell-sdk-go","last_synced_at":"2025-07-19T04:36:25.216Z","repository":{"id":234536645,"uuid":"788806472","full_name":"oceanbase/obshell-sdk-go","owner":"oceanbase","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-11T07:03:44.000Z","size":157,"stargazers_count":2,"open_issues_count":3,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-11T10:50:34.490Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oceanbase.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-19T05:55:10.000Z","updated_at":"2025-07-11T07:03:47.000Z","dependencies_parsed_at":"2024-06-19T03:04:40.577Z","dependency_job_id":"1bc595ea-656c-464f-8d09-ea1005e066c8","html_url":"https://github.com/oceanbase/obshell-sdk-go","commit_stats":null,"previous_names":["oceanbase/obshell-sdk-go"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/oceanbase/obshell-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oceanbase","download_url":"https://codeload.github.com/oceanbase/obshell-sdk-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265889158,"owners_count":23844539,"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-07-19T04:36:24.554Z","updated_at":"2025-07-19T04:36:25.166Z","avatar_url":"https://github.com/oceanbase.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/oceanbase/oceanbase/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"license\" src=\"https://img.shields.io/badge/license-Apache--2.0-blue\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://en.oceanbase.com/docs/oceanbase-database\"\u003e\n    \u003cimg alt=\"English doc\" src=\"https://img.shields.io/badge/docs-English-blue\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.oceanbase.com/docs/oceanbase-database-cn\"\u003e\n    \u003cimg alt=\"Chinese doc\" src=\"https://img.shields.io/badge/文档-简体中文-blue\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nEnglish | [Chinese](README_CN.md)\n\n\n**OBShell-SDK-GO** is an SDK provided by the[OceanBase Community](https://open.oceanbase.com/) to facilitate developers with quick access to OBShell services, allowing them to conveniently call OBShell interfaces using this SDK.\n\n## Install\n```shell\ngo get github.com/oceanbase/obshell-sdk-go@master\n```\n\n## Quick Start\nPlease ensure that OBShell is running when using it.\n### Create a Client\nYou can choose to create a single-version client.\n``` GO\npackage main\n\nimport (\n\t\"github.com/oceanbase/obshell-sdk-go/services/v1\"\n)\n\nfunc main() {\n\tclient, err := v1.NewClientWithPassword(\"11.11.11.1\", 2886, \"***\")\n\tif err != nil {\n        // Handle error.\n\t\treturn\n\t}\n}\n```\nOr create a multi-version client set.\n``` GO\npackage main\n\nimport (\n\t\"github.com/oceanbase/obshell-sdk-go/services\"\n)\n\nfunc main() {\n\tclientset, err := services.NewClientWithPassword(\"11.11.11.1\", 2886, \"****\")\n\tif err != nil {\n        // Handle error.\n\t\treturn\n\t}\n}\n```\n### Deploy Cluster\n``` GO\npackage main\n\nimport (\n\t\"github.com/oceanbase/obshell-sdk-go/services\"\n\t\"github.com/oceanbase/obshell-sdk-go/services/v1\"\n)\n\nfunc main() {\n\tclient, err := services.NewClientWithPassword(\"11.11.11.1\", 2886, \"****\")\n\tif err != nil {\n\t\treturn\n\t}\n\tjoinReqeust1 := client.V1().NewJoinRequest(\"11.11.11.1\", 2886, \"zone1\")\n\tif _, err := client.V1().JoinSyncWithRequest(joinReqeust1); err != nil {\n\t\treturn\n\t}\n\n\tjoinReqeust2 := client.V1().NewJoinRequest(\"11.11.11.2\", 2886, \"zone2\")\n\tif _, err := client.V1().JoinSyncWithRequest(joinReqeust2); err != nil {\n\t\treturn\n\t}\n\n\tjoinReqeust3 := client.V1().NewJoinRequest(\"11.11.11.3\", 2886, \"zone3\")\n\tif _, err := client.V1().JoinSyncWithRequest(joinReqeust3); err != nil {\n\t\treturn\n\t}\n\n\t// Configure the cluster.\n\tconfigObclusterReq := client.V1().NewConfigObclusterRequest(\"obshell-sdk-test\", 12358).SetRootPwd(\"****\")\n\tif _, err := client.V1().ConfigObclusterSyncWithRequest(configObclusterReq); err != nil {\n\t\treturn\n\t}\n\n\t// Configure the observers.\n\tconfigs := map[string]string{\n\t\t\"datafile_size\": \"24G\", \"cpu_count\": \"16\", \"memory_limit\": \"16G\", \"system_memory\": \"8G\", \"log_disk_size\": \"24G\",\n\t}\n\tconfigObserverReq := client.V1().NewConfigObserverRequest(configs, v1.SCOPE_GLOBAL)\n\tif _, err := client.V1().ConfigObserverSyncWithRequest(configObserverReq); err != nil {\n\t\treturn\n\t}\n\n\t// Initialize the cluster.\n\tinitReq := client.V1().NewInitRequest()\n\tif _, err := client.V1().InitSyncWithRequest(initReq); err != nil {\n\t\treturn\n\t}\n}\n```\n### Scale out\n``` GO\npackage main\n\nimport (\n\t\"github.com/oceanbase/obshell-sdk-go/services\"\n)\n\nfunc main() {\n\tclient, err := services.NewClientWithPassword(\"11.11.11.1\", 2886, \"****\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// OBShell prior to 4.2.3.0 should use mysqlPort(rpcPort) instead of mysql_port(rpc_port).\n\tconfigs := map[string]string{\n\t\t\"mysql_port\": \"2881\", \"rpc_port\": \"2882\", \"datafile_size\": \"24G\", \"cpu_count\": \"16\", \"memory_limit\": \"16G\", \"system_memory\": \"8G\", \"log_disk_size\": \"24G\",\n\t}\n\n\t// Scale out a new server in zone3.\n\tscaleOutReq := client.V1().NewScaleOutRequest(\"11.11.11.3\", 2886, \"zone3\", configs)\n\tif _, err := client.V1().ScaleOutSyncWithRequest(scaleOutReq); err != nil {\n\t\treturn\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foceanbase%2Fobshell-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foceanbase%2Fobshell-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foceanbase%2Fobshell-sdk-go/lists"}