Categorygithub.com/polarismesh/polaris-go
modulepackage
1.6.0-beta.5
Repository: https://github.com/polarismesh/polaris-go.git
Documentation: pkg.go.dev

# README

Polaris Go

codecov Go goproxy Go Reference GitHub release (latest by date)

English | 简体中文

README:

Introduction

Polaris-go is golang SDK for Polaris. Polaris is an operation centre that supports multiple programming languages, with high compatibility to different application framework.

Polaris-go provide features listed as below:

  • Service instance registration, and health check

    Provides API on/offline registration instance information, with regular report to inform caller server's healthy status.

  • Service discovery

    Provides multiple API, for users to get a full list of server instance, or get one server instance after route rule filtering and loadbalancing, which can be applied to srevice invocation soon.

  • Service circuitbreaking

    Provide API to report the invocation result, and conduct circuit breaker instance/group insolation based on collected data, eventually recover when the system allows.

  • Service ratelimiting

    Provides API for applications to conduct quota check and deduction, supports rate limit policies that are based on server level and port.

How to use

polaris-go can be referenced by go mod, user can add dependency to go.mod file

go get -u github.com/polarismesh/polaris-go

API quick start guide,can reference:QuickStart

Examples

A polaris-examples module is included in our project for you to get started with polaris-go quickly. It contains an example, and you can refer to the readme file in the example project for a quick walkthrough.

Frameworks

Developers usually use HTTP or RPC frameworks to develop distributed service. Polaris SDK is already integrated into some development frameworks. If using these frameworks, you can enable Polaris Service Governance functions without using Polaris SDK directly.

# Packages

Package api is the core API of polaris-go, which provides the basic functions of service discovery and.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewCircuitBreakerAPI 获取 CircuitBreakerAPI.
NewCircuitBreakerAPIByConfig 通过配置对象获取 CircuitBreakerAPI.
NewCircuitBreakerAPIByContext 通过上下文对象获取 CircuitBreakerAPI.
NewCircuitBreakerAPIByFile 通过配置文件获取 CircuitBreakerAPI.
NewConfigAPI 获取配置中心 API.
NewConfigAPIByConfig 通过配置对象获取配置中心 API.
NewConfigAPIByContext 通过上下文对象获取配置中心 API.
NewConfigAPIByFile 通过配置文件获取配置中心 API.
NewConfigGroupAPI 获取配置中心 API.
NewConfigAPIByConfig 通过配置对象获取配置中心 API.
NewConfigAPIByContext 通过上下文对象获取配置中心 API.
NewConfigAPIByFile 通过配置文件获取配置中心 API.
NewConsumerAPI 创建调用者API.
NewConsumerAPIByAddress 创建调用者API.
NewConsumerAPIByConfig 创建调用者API.
NewConsumerAPIByContext 创建调用者API.
NewConsumerAPIByFile 创建调用者API.
NewLimitAPI 通过以默认域名为埋点server的默认配置创建LimitAPI.
NewLimitAPIByAddress 通过地址创建SDK LimitAPI对象.
NewLimitAPIByConfig 通过配置对象创建SDK LimitAPI对象.
NewLimitAPIByContext 通过上下文创建SDK LimitAPI对象.
NewLimitAPIByFile 通过配置文件创建SDK LimitAPI对象.
NewProviderAPI 通过以默认域名为埋点server的默认配置创建ProviderAPI.
NewProviderAPIByAddress 通过address创建ProviderAPI.
NewProviderAPIByConfig 通过配置对象创建SDK ProviderAPI对象.
NewProviderAPIByContext 通过上下文创建SDK ProviderAPI对象.
NewProviderAPIByFile 通过配置文件创建SDK ProviderAPI对象.
NewQuotaRequest example create a quota query request.
NewRouterAPI 通过以默认域名为埋点server的默认配置创建RouterAPI.
NewRouterAPIByAddress 通过address创建RouterAPI.
NewRouterAPIByConfig 通过配置对象创建SDK RouterAPI对象.
NewRouterAPIByContext 通过上下文创建SDK RouterAPI对象.
NewRouterAPIByFile 通过配置文件创建SDK RouterAPI对象.
NewSDKContext 创建SDK上下文.
NewSDKContextByAddress 根据address创建SDK上下文.
NewSDKContextByConfig 根据配置创建SDK上下文.

# Structs

ProcessLoadBalanceRequest process load balancer to get the target instances.
ProcessRoutersRequest process routers to filter instances.

# Interfaces

No description provided by the author
ConfigAPI api for configuration files.
ConfigGroupAPI .
ConsumerAPI 主调端API方法.
LimitAPI 限流相关的API相关接口.
ProviderAPI CL5服务端API的主接口.
RouterAPI routing api methods.

# Type aliases

ConfigFile config.
GetAllInstancesRequest is the request struct for GetAllInstances.
No description provided by the author
GetInstancesRequest is the request struct for GetInstances.
GetOneInstanceRequest is the request struct for GetOneInstance.
GetServiceRuleRequest is the request struct for GetServiceRule.
GetServicesRequest is the request struct for GetServices.
InitCalleeServiceRequest is the request struct for InitCalleeService.
InstanceDeRegisterRequest 实例注销请求.
InstanceHeartbeatRequest 实例心跳请求.
InstanceRegisterRequest 实例注册请求.
QuotaFuture rate limiter.
QuotaRequest rate limiter.
ServiceCallResult is the response struct for ServiceCall.
WatchAllInstancesRequest is the request to watch instances.
WatchAllServicesRequest is the request to watch services.
WatchServiceRequest is the request struct for WatchService.