Giter Site home page Giter Site logo

specification's Introduction

服务治理标准

English | 简体中文


README:

介绍

服务治理标准

北极星服务治理标准遵循下一代架构基金会所制定的服务治理标准,在此之上进行了扩展:

Latest Release
Serivce Management Specification
namespace v1
service v1
instance v1
health check v1
Traffic Mangement Specification
router v1
load balancer v1
limiter v1
Fault Tolerance Specification
circuit breaker v1
fault detector v1
retry v1
Access Control Specification
authentication v1
anthorization v1

服务治理接口

Latest Release
Serivce Management Specification
namespace v1
service v1
instance v1
health check v1
Traffic Mangement Specification
router v1
load balancer v1
limiter v1
Fault Tolerance Specification
circuit breaker v1
fault detector v1
Access Control Specification
authentication v1

如何构建

  • Java语言

Java的编译相关的工程在/source/java/polaris-specification下,通过以下命令可以构建:

cd source/java
bash build.sh
  • Go语言

Go的编译相关工程在/source/go下,通过以下命令可以构建

cd source/go
rm -rf api
bash build.sh
  • Rust语言

Rust的编译相关工程在/source/rust/polaris-specification,通过以下命令可以构建

cd source/rust
bash build.sh

如何使用

  • Java语言,只需要添加polaris-specification的依赖即可完成。
<dependency>
    <groupId>com.tencent.polaris</groupId>
    <artifactId>polaris-specification</artifactId>
    <!-- 版本号可换成最新版本号-->
    <version>v1.3.0</version>
</dependency>
  • Go语言,修改go.mod,添加github.com/polarismesh/specification的依赖。
require github.com/polarismesh/specification v1.3.0
  • Rust语言,修改cargo.toml,添加polaris-specification的依赖。
[dependencies]
polaris-specification = "1.3"

specification's People

Contributors

alexwanglei avatar andrewshan avatar chuntaojun avatar daheige avatar fabian4 avatar houseme avatar lepdou avatar melodyl-xyz avatar movebean avatar pemako avatar polaris-admin avatar ranchowang avatar shedfreez avatar skyebefreeman avatar skywli avatar stringke avatar zilongtong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

specification's Issues

github.com/polarismesh/[email protected]: verifying module: checksum mismatch

polarismesh/specification 安装失败

go clean -modcache && go mod tidy

提示:
github.com/polarismesh/specification/source/go/api/v1/model: github.com/polarismesh/[email protected]: verifying module: checksum mismatch
downloaded: h1:Rh+Ayz1L2b43CQx+KaBBGgaqMHJ+grrovPRSqA967ZI=
sum.golang.org: h1:fm7sUtFZC2g9+lLmRCtjGrUow47CY5JDFoZXwwCQGGY=

SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

服务契约

目的

  1. 查看服务提供的接口和参数信息
  2. 发起mock请求

相关规范

  1. openapi https://spec.openapis.org/oas/v3.1.0
  2. opensergo https://github.com/opensergo/opensergo-proto/blob/main/opensergo/proto/service_contract/v1/service_contract.proto

openapi

对应 http 协议。

规范定义从整体来看分为两部分 Paths 和 Components

  • Paths 定义 url 接口方法
  • Components 定义参数结构

opensergo

看起来主要对应 grpc 协议

规范定义从整体来看分为两部分 Paths 和 Components

  • ServiceDescriptor 定义接口方法
  • TypeDescriptor 定义参数结构

服务契约

现有服务契约的定义与RPC协议深度绑定,原因也很简单,得有协议相关的完整信息才方便进行处理。

如果只做服务信息的展示,可以抽象出几个通用的概念:

ServiceContract
  - InterfaceDescriptor // 一个服务里有多个接口
    - MethodDescriptor // 一个接口里有多个方法,其中包含输入输出参数类型
  - TypeDescriptor // 参数的类型定义

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.