stack-labs / starter-kit Goto Github PK
View Code? Open in Web Editor NEWstack-rpc 快速开发包
License: Apache License 2.0
stack-rpc 快速开发包
License: Apache License 2.0
放弃Hipster Shop示例是什么意思? 还不能用就放弃不开放了?
是直接传db进去,还是怎样呢?
统一使用micro api
网关,不需要micro web
It's a way to put errors from example
func (*Account) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.Response) error {
automaticaly to span ? Maybe some changes in warrper ?
I added
return func(h server.HandlerFunc) server.HandlerFunc {
return func(ctx context.Context, req server.Request, rsp interface{}) error {
if ot == nil {
ot = opentracing.GlobalTracer()
}
name := fmt.Sprintf("%s", req.Endpoint())
ctx, span, err := SpanFromContext(ctx, ot, name)
span.LogKV("reg", req)
span.LogKV("rsp", rsp)
but i don't know how to catch error from Login func
starter-kit/app/console/web/statik: cannot find module providing package github.com/micro-in-cn/starter-kit/app/console/web/statik
go:generate statik -src=./vue/dist -dest=./ -f 怎么操作?
只开gateway与web,网关应该也是可以代理的吧。但是报找不到服务
curl http://localhost:8080/v1/gin
返回:{"id":"go.micro.api","code":500,"detail":"service not found","status":"Internal Server Error"}
The codahale/hdrhistogram repo has been transferred under the github HdrHstogram umbrella with the help from the original author in Sept 2020 (new repo url https://github.com/HdrHistogram/hdrhistogram-go). The main reasons are to group all implementations under the same roof and to provide more active contribution from the community as the original repository was archived several years ago.
The dependency URL should be modified to point to the new repository URL. The tag "v0.9.0" was applied at the point of transfer and will reflect the exact code that was frozen in the original repository.
If you are using Go modules, you can update to the exact point of transfer using the @v0.9.0 tag in your go get command.
go mod edit -replace github.com/codahale/hdrhistogram=github.com/HdrHistogram/[email protected]
From the point of transfer, up until now (mon 16 aug 2021), we've released 3 versions that aim support the standard HdrHistogram serialization/exposition formats, and deeply improve READ performance.
We recommend to update to the latest version.
https://github.com/micro-in-cn/starter-kit/blob/master/pkg/plugin/wrapper/select/chain/chain.go#L39
ok, i := inArray(val, chains)
if ok && idx > i {
// 出现优先链路,services清空,nodes清空
39行 idx = i
services = services[:0]
nodes = nodes[:0]
}
ok=true的情况下,i 是 大于等于 0的。 所以 39行 是执行不到的。
我的理解是否有误? 谢谢
rm -rf ${gen}/*
protoc --proto_path=${GOPATH}/src:${PB_PATH} \
这什么人写的代码,就开出来了
Rancher是开源软件,它结合了组织需要采用的所有组件,并在生产环境中运行容器。Rancher基于Kubernetes构建,使DevOps团队可以轻松测试、部署和管理他们的应用程序。运维团队使用Rancher来部署、管理和维护各个Kubernetes集群,而不需关心它运行在何处。
stages:
# 依赖 redis 部署
- name: Redis
steps:
- applyAppConfig:
catalogTemplate: cattle-global-data:library-redis
version: 3.0.2
answers:
master.persistence.enabled: "true"
cluster.slaveCount: "2"
name: redis
targetNamespace: api
# 配置部署
- name: Config
steps:
- applyYamlConfig:
path: ./config.yaml
# rpc 接口部署
- name: Micro
steps:
- applyYamlConfig:
path: ./app/micro-api.yaml
# user 用户数据库
- name: UserMariadb
steps:
- applyAppConfig:
catalogTemplate: cattle-global-data:library-mariadb
version: 5.0.9
answers:
db.name: user
db.user: user
service.type: ClusterIP
slave.replicas: "2"
name: user
targetNamespace: srv
# user 用户服务
- name: User
steps:
- applyYamlConfig:
path: ./app/user.yaml
# user-api 用户 API 服务
- name: UserApi
steps:
- applyYamlConfig:
path: ./app/user-api.yaml
# 负载均衡
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: micro-ingress
namespace: api
spec:
rules:
- host: xip.io
http:
paths:
- backend:
serviceName: micro
servicePort: http
---
apiVersion: v1
kind: Service
metadata:
name: micro
namespace: api
spec:
selector:
app: micro
type: ClusterIP
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: micro
namespace: api
labels:
app: micro
spec:
replicas: 3
selector:
matchLabels:
app: micro
template:
metadata:
labels:
app: micro
spec:
serviceAccountName: micro-services
containers:
- name: micro
image: microhq/micro:kubernetes
args:
- "api"
- "--handler=rpc"
- "--address=0.0.0.0:8080"
env:
- name: MICRO_SERVER_NAME
value: micro
- name: MICRO_SERVER_ADDRESS
value: 0.0.0.0:8989
ports:
- containerPort: 8080
name: http
protocol: TCP
- name: health
command: [
"/health",
"--health_address=0.0.0.0:8081",
"--server_name=micro",
"--server_address=0.0.0.0:8989"
]
image: microhq/health:kubernetes
livenessProbe:
httpGet:
path: /health
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
kind: Service
apiVersion: v1
metadata:
name: user
namespace: srv
spec:
selector:
app: user
type: ClusterIP
ports:
- protocol: TCP
port: 8080
name: micro
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: user
namespace: srv
labels:
app: user
spec:
replicas: 1
selector:
matchLabels:
app: user
template:
metadata:
labels:
app: user
spec:
serviceAccountName: micro-services
imagePullSecrets:
- name: pipeline-docker-registry
containers:
- name: user
image: gmsa/user:latest
imagePullPolicy: Always
command: [
"service",
"--selector=static",
"--server_address=:8080",
]
env:
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
key: admin-password
name: user
- name: APP_KEY
valueFrom:
secretKeyRef:
key: app-key
name: user
- name: TOKEN_VALIDITY_PERIOD
value: "15"
- name: DB_HOST
value: "user-mariadb"
- name: DB_USER
value: "user"
- name: DB_NAME
value: "user"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: mariadb-password
name: user-mariadb
ports:
- containerPort: 8080
name: micro
protocol: TCP
- name: health
image: microhq/health:kubernetes
command: [
"/health",
"--health_address=0.0.0.0:8081",
"--server_name=user",
"--server_address=0.0.0.0:8080"
]
livenessProbe:
httpGet:
path: /health
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
第一个问题:现在是gateway ->web/api -> srv ,是不是直接 gateway->srv 就好了
第二个问题:现在gateway api 项目,可以线上使用了吗?
错误码
\pkg\mod\github.com\micro\[email protected]\runtime\process\os\os.go:29:41: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr
我点击进去的时候,发现这个版本下已经没有这些对应的属性值了unknown field 'Setpgid'
,undefined: syscall.Getpgid
,undefined: syscall.Kill
,
想问一下 这个启动的go版本是?
如用postgresql 应怎样配置?
protoc --proto_path=/Users/ln/gopath/src:. --micro_out=. --go_out=. proto/*/*.proto
github.com/micro/go-micro/api/proto/api.proto: File not found.
proto/api/account.proto:5:1: Import "github.com/micro/go-micro/api/proto/api.proto" was not found or had errors.
proto/api/account.proto:8:16: "go.api.Request" is not defined.
proto/api/account.proto:8:41: "go.api.Response" is not defined.
proto/api/account.proto:10:17: "go.api.Request" is not defined.
proto/api/account.proto:10:42: "go.api.Response" is not defined.
proto/api/account.proto:12:15: "go.api.Request" is not defined.
proto/api/account.proto:12:40: "go.api.Response" is not defined.
I want to rename some services for test I am working on in Linkerd, so instead of using adservice
in services.yaml, I will have adservice-east
. so the frontend
will send request to adservice-east
instead of adservice
I am not a GO programmer, I would be grateful if anybody can point me where this can be done in the frontservice
source code
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.