# go-sc-client **Repository Path**: mirrors_go-chassis/go-sc-client ## Basic Information - **Project Name**: go-sc-client - **Description**: Go client of ServiceComb Service Center - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Service Center client for go This is a service center client which helps the microservice to interact with Service Center for service-registration, discovery, instance registration etc. This client implements [API](https://github.com/apache/servicecomb-service-center/blob/master/docs/openapi/v4.yaml) of Service Center. # Usage ```go registryClient, err := sc.NewClient( sc.Options{ Addrs: []string{"127.0.0.1:30100"}, }) ``` declare and register micro service ```go var ms = new(discovery.MicroService) var m = make(map[string]string) m["abc"] = "abc" m["def"] = "def" ms.AppId = MSList[0].AppId ms.ServiceName = MSList[0].ServiceName ms.Version = MSList[0].Version ms.Environment = MSList[0].Environment ms.Properties = m sid, err := registryClient.RegisterService(ms) ``` declare and register instance ```go microServiceInstance := &discovery.MicroServiceInstance{ Endpoints: []string{"rest://127.0.0.1:3000"}, HostName: hostname, Status: sc.MSInstanceUP, } id, err := registryClient.RegisterMicroServiceInstance(microServiceInstance) ```