Documentation ¶
Index ¶
- Constants
- func GenNewZoneCode(env, zoneCode string) string
- func Init()
- type GovernStatus
- type GrpcGovern
- func (g *GrpcGovern) Get(env, zoneCode string, url string, v map[string]string, resp interface{}) (err error)
- func (g *GrpcGovern) GovernStatus(zoneCode string) HealthStatus
- func (g *GrpcGovern) Post(env, zoneCode string, url string, v interface{}, resp interface{}) (err error)
- func (g *GrpcGovern) PostStream(env, zoneCode string, url string, v interface{}) (stream []byte, err error)
- type HealthStatus
Constants ¶
View Source
const ( UrlProviderV2Info = "/v2/provider/info" UrlPprofV1Info = "/api/v1/pprof/info" UrlGovernInfo = "/v2/govern/%s/%d" UrlEtcdInfo = "/api/etcdctl/%s/%s" UrlGovernEvent = "/api/provider/%s/events" // /api/provider/:appname/events UrlConfigurators = "/v2/configurators/put" // 聚合provider,configurators, 第一个为appname,第二个为typeid // typeid 1为grpc,2为http UrlBaseAggregation = "/v2/aggregation/base/%s/%d" UrlConfigServerPut = "/v1/configserver/put" UrlConfigServerInfo = "/v1/configserver/%s/%d/%s" UrlAliLoggerDashboard = "/v1/alilogger/dashboard/%s/%s" UrlAliLoggerLogStore = "/v1/alilogger/logstore/%s/%s/%s" )
View Source
const ( EtcdRegister = "register" EtcdConfigServer = "config" EtcdSentinel = "sentinel" )
Variables ¶
This section is empty.
Functions ¶
func GenNewZoneCode ¶
Types ¶
type GovernStatus ¶
type GovernStatus string
const ( GovernOK GovernStatus = "ok" GovernTimeout GovernStatus = "timeout" GovernInvalidDomain GovernStatus = "invalid_domain" GovernUnknownError GovernStatus = "unknown_error" GovernUnknown GovernStatus = "unknown" )
type GrpcGovern ¶
type GrpcGovern struct { DomainMap map[string]string // ZoneCode对应域名 Token string *resty.Client // contains filtered or unexported fields }
var IGrpcGovern *GrpcGovern
func InitGrpcGovern ¶
func InitGrpcGovern() *GrpcGovern
func (*GrpcGovern) Get ¶
func (g *GrpcGovern) Get(env, zoneCode string, url string, v map[string]string, resp interface{}) (err error)
PostJSON post json 数据请求
func (*GrpcGovern) GovernStatus ¶
func (g *GrpcGovern) GovernStatus(zoneCode string) HealthStatus
func (*GrpcGovern) Post ¶
func (g *GrpcGovern) Post(env, zoneCode string, url string, v interface{}, resp interface{}) (err error)
PostJSON post json 数据请求
func (*GrpcGovern) PostStream ¶
func (g *GrpcGovern) PostStream(env, zoneCode string, url string, v interface{}) (stream []byte, err error)
PostJSON post json 数据请求
type HealthStatus ¶
type HealthStatus struct { Status GovernStatus Message string // 如果服务有异常,这里显示错误信息 }
Click to show internal directories.
Click to hide internal directories.