diff --git a/deploy/goctl/1.5.3/api/config.tpl b/deploy/goctl/1.5.3/api/config.tpl new file mode 100644 index 00000000..55127efb --- /dev/null +++ b/deploy/goctl/1.5.3/api/config.tpl @@ -0,0 +1,9 @@ +package config + +import {{.authImport}} + +type Config struct { + rest.RestConf + {{.auth}} + {{.jwtTrans}} +} diff --git a/deploy/goctl/1.5.3/api/context.tpl b/deploy/goctl/1.5.3/api/context.tpl new file mode 100644 index 00000000..c15c1e45 --- /dev/null +++ b/deploy/goctl/1.5.3/api/context.tpl @@ -0,0 +1,17 @@ +package svc + +import ( + {{.configImport}} +) + +type ServiceContext struct { + Config {{.config}} + {{.middleware}} +} + +func NewServiceContext(c {{.config}}) *ServiceContext { + return &ServiceContext{ + Config: c, + {{.middlewareAssignment}} + } +} diff --git a/deploy/goctl/1.5.3/api/etc.tpl b/deploy/goctl/1.5.3/api/etc.tpl new file mode 100644 index 00000000..ed55cf1b --- /dev/null +++ b/deploy/goctl/1.5.3/api/etc.tpl @@ -0,0 +1,3 @@ +Name: {{.serviceName}} +Host: {{.host}} +Port: {{.port}} diff --git a/deploy/goctl/1.5.3/api/handler.tpl b/deploy/goctl/1.5.3/api/handler.tpl new file mode 100644 index 00000000..15989375 --- /dev/null +++ b/deploy/goctl/1.5.3/api/handler.tpl @@ -0,0 +1,24 @@ +package {{.PkgName}} + +import ( + "net/http" + + "PCM/common/result" + + "github.com/zeromicro/go-zero/rest/httpx" + {{.ImportPackages}} +) + +func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + {{if .HasRequest}}var req types.{{.RequestType}} + if err := httpx.Parse(r, &req); err != nil { + result.ParamErrorResult(r,w,err) + return + } + + {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx) + {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}&req{{end}}) + result.HttpResult(r, w, {{if .HasResp}}resp{{else}}nil{{end}}, err) + } +} diff --git a/deploy/goctl/1.5.3/api/logic.tpl b/deploy/goctl/1.5.3/api/logic.tpl new file mode 100644 index 00000000..7c043237 --- /dev/null +++ b/deploy/goctl/1.5.3/api/logic.tpl @@ -0,0 +1,25 @@ +package {{.pkgName}} + +import ( + {{.imports}} +) + +type {{.logic}} struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} { + return &{{.logic}}{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} { + // todo: add your logic here and delete this line + + {{.returnString}} +} diff --git a/deploy/goctl/1.5.3/api/main.tpl b/deploy/goctl/1.5.3/api/main.tpl new file mode 100644 index 00000000..ad1a46d0 --- /dev/null +++ b/deploy/goctl/1.5.3/api/main.tpl @@ -0,0 +1,26 @@ +package main + +import ( + "flag" + "fmt" + + {{.importPackages}} +) + +var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + + server := rest.MustNewServer(c.RestConf) + defer server.Stop() + + ctx := svc.NewServiceContext(c) + handler.RegisterHandlers(server, ctx) + + fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) + server.Start() +} diff --git a/deploy/goctl/1.5.3/api/middleware.tpl b/deploy/goctl/1.5.3/api/middleware.tpl new file mode 100644 index 00000000..3a9f8e91 --- /dev/null +++ b/deploy/goctl/1.5.3/api/middleware.tpl @@ -0,0 +1,19 @@ +package middleware + +import "net/http" + +type {{.name}} struct { +} + +func New{{.name}}() *{{.name}} { + return &{{.name}}{} +} + +func (m *{{.name}})Handle(next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + // TODO generate middleware implement function, delete after code implementation + + // Passthrough to next handler if need + next(w, r) + } +} diff --git a/deploy/goctl/1.5.3/api/route-addition.tpl b/deploy/goctl/1.5.3/api/route-addition.tpl new file mode 100644 index 00000000..ec9edf0d --- /dev/null +++ b/deploy/goctl/1.5.3/api/route-addition.tpl @@ -0,0 +1,4 @@ + + server.AddRoutes( + {{.routes}} {{.jwt}}{{.signature}} {{.prefix}} {{.timeout}} + ) diff --git a/deploy/goctl/1.5.3/api/routes.tpl b/deploy/goctl/1.5.3/api/routes.tpl new file mode 100644 index 00000000..f13fb111 --- /dev/null +++ b/deploy/goctl/1.5.3/api/routes.tpl @@ -0,0 +1,13 @@ +// Code generated by goctl. DO NOT EDIT. +package handler + +import ( + "net/http"{{if .hasTimeout}} + "time"{{end}} + + {{.importPackages}} +) + +func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { + {{.routesAdditions}} +} diff --git a/deploy/goctl/1.5.3/api/template.tpl b/deploy/goctl/1.5.3/api/template.tpl new file mode 100644 index 00000000..2176441c --- /dev/null +++ b/deploy/goctl/1.5.3/api/template.tpl @@ -0,0 +1,24 @@ +syntax = "v1" + +info ( + title: // TODO: add title + desc: // TODO: add description + author: "{{.gitUser}}" + email: "{{.gitEmail}}" +) + +type request { + // TODO: add members here and delete this comment +} + +type response { + // TODO: add members here and delete this comment +} + +service {{.serviceName}} { + @handler GetUser // TODO: set handler name and delete this comment + get /users/id/:userId(request) returns(response) + + @handler CreateUser // TODO: set handler name and delete this comment + post /users/create(request) +} diff --git a/deploy/goctl/1.5.3/api/types.tpl b/deploy/goctl/1.5.3/api/types.tpl new file mode 100644 index 00000000..735ec2da --- /dev/null +++ b/deploy/goctl/1.5.3/api/types.tpl @@ -0,0 +1,6 @@ +// Code generated by goctl. DO NOT EDIT. +package types{{if .containsTime}} +import ( + "time" +){{end}} +{{.types}} diff --git a/deploy/goctl/1.5.3/docker/docker.tpl b/deploy/goctl/1.5.3/docker/docker.tpl new file mode 100644 index 00000000..d1b5ff44 --- /dev/null +++ b/deploy/goctl/1.5.3/docker/docker.tpl @@ -0,0 +1,33 @@ +FROM golang:{{.Version}}alpine AS builder + +LABEL stage=gobuilder + +ENV CGO_ENABLED 0 +{{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +{{end}}{{if .HasTimezone}} +RUN apk update --no-cache && apk add --no-cache tzdata +{{end}} +WORKDIR /build + +ADD go.mod . +ADD go.sum . +RUN go mod download +COPY . . +{{if .Argument}}COPY {{.GoRelPath}}/etc /app/etc +{{end}}RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}} + + +FROM {{.BaseImage}} + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +{{if .HasTimezone}}COPY --from=builder /usr/share/zoneinfo/{{.Timezone}} /usr/share/zoneinfo/{{.Timezone}} +ENV TZ {{.Timezone}} +{{end}} +WORKDIR /app +COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}{{if .Argument}} +COPY --from=builder /app/etc /app/etc{{end}} +{{if .HasPort}} +EXPOSE {{.Port}} +{{end}} +CMD ["./{{.ExeFile}}"{{.Argument}}] diff --git a/deploy/goctl/1.5.3/kube/deployment.tpl b/deploy/goctl/1.5.3/kube/deployment.tpl new file mode 100644 index 00000000..95c698cb --- /dev/null +++ b/deploy/goctl/1.5.3/kube/deployment.tpl @@ -0,0 +1,113 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{.Name}} + namespace: {{.Namespace}} + labels: + app: {{.Name}} +spec: + replicas: {{.Replicas}} + revisionHistoryLimit: {{.Revisions}} + selector: + matchLabels: + app: {{.Name}} + template: + metadata: + labels: + app: {{.Name}} + spec:{{if .ServiceAccount}} + serviceAccountName: {{.ServiceAccount}}{{end}} + containers: + - name: {{.Name}} + image: {{.Image}} + {{if .ImagePullPolicy}}imagePullPolicy: {{.ImagePullPolicy}} + {{end}}ports: + - containerPort: {{.Port}} + readinessProbe: + tcpSocket: + port: {{.Port}} + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: {{.Port}} + initialDelaySeconds: 15 + periodSeconds: 20 + resources: + requests: + cpu: {{.RequestCpu}}m + memory: {{.RequestMem}}Mi + limits: + cpu: {{.LimitCpu}}m + memory: {{.LimitMem}}Mi + volumeMounts: + - name: timezone + mountPath: /etc/localtime + {{if .Secret}}imagePullSecrets: + - name: {{.Secret}} + {{end}}volumes: + - name: timezone + hostPath: + path: /usr/share/zoneinfo/Asia/Shanghai + +--- + +apiVersion: v1 +kind: Service +metadata: + name: {{.Name}}-svc + namespace: {{.Namespace}} +spec: + ports: + {{if .UseNodePort}}- nodePort: {{.NodePort}} + port: {{.Port}} + protocol: TCP + targetPort: {{.TargetPort}} + type: NodePort{{else}}- port: {{.Port}} + targetPort: {{.TargetPort}}{{end}} + selector: + app: {{.Name}} + +--- + +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{.Name}}-hpa-c + namespace: {{.Namespace}} + labels: + app: {{.Name}}-hpa-c +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{.Name}} + minReplicas: {{.MinReplicas}} + maxReplicas: {{.MaxReplicas}} + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: 80 + +--- + +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{.Name}}-hpa-m + namespace: {{.Namespace}} + labels: + app: {{.Name}}-hpa-m +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{.Name}} + minReplicas: {{.MinReplicas}} + maxReplicas: {{.MaxReplicas}} + metrics: + - type: Resource + resource: + name: memory + targetAverageUtilization: 80 diff --git a/deploy/goctl/1.5.3/kube/job.tpl b/deploy/goctl/1.5.3/kube/job.tpl new file mode 100644 index 00000000..0da72ede --- /dev/null +++ b/deploy/goctl/1.5.3/kube/job.tpl @@ -0,0 +1,37 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{.Name}} + namespace: {{.Namespace}} +spec: + successfulJobsHistoryLimit: {{.SuccessfulJobsHistoryLimit}} + schedule: "{{.Schedule}}" + jobTemplate: + spec: + template: + spec:{{if .ServiceAccount}} + serviceAccountName: {{.ServiceAccount}}{{end}} + {{end}}containers: + - name: {{.Name}} + image: # todo image url + resources: + requests: + cpu: {{.RequestCpu}}m + memory: {{.RequestMem}}Mi + limits: + cpu: {{.LimitCpu}}m + memory: {{.LimitMem}}Mi + command: + - ./{{.ServiceName}} + - -f + - ./{{.Name}}.yaml + volumeMounts: + - name: timezone + mountPath: /etc/localtime + imagePullSecrets: + - name: # registry secret, if no, remove this + restartPolicy: OnFailure + volumes: + - name: timezone + hostPath: + path: /usr/share/zoneinfo/Asia/Shanghai diff --git a/deploy/goctl/1.5.3/model/delete.tpl b/deploy/goctl/1.5.3/model/delete.tpl new file mode 100644 index 00000000..fb995c26 --- /dev/null +++ b/deploy/goctl/1.5.3/model/delete.tpl @@ -0,0 +1,14 @@ +func (m *default{{.upperStartCamelObject}}Model) Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error { + {{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, {{.lowerStartCamelPrimaryKey}}) + if err!=nil{ + return err + } + +{{end}} {{.keys}} + _, err {{if .containsIndexCache}}={{else}}:={{end}} m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table) + return conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}}) + }, {{.keyValues}}){{else}}query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table) + _,err:=m.conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}}){{end}} + return err +} diff --git a/deploy/goctl/1.5.3/model/err.tpl b/deploy/goctl/1.5.3/model/err.tpl new file mode 100644 index 00000000..dc5eac4a --- /dev/null +++ b/deploy/goctl/1.5.3/model/err.tpl @@ -0,0 +1,5 @@ +package {{.pkg}} + +import "github.com/zeromicro/go-zero/core/stores/sqlx" + +var ErrNotFound = sqlx.ErrNotFound diff --git a/deploy/goctl/1.5.3/model/field.tpl b/deploy/goctl/1.5.3/model/field.tpl new file mode 100644 index 00000000..6b4ed387 --- /dev/null +++ b/deploy/goctl/1.5.3/model/field.tpl @@ -0,0 +1 @@ +{{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}} \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/find-one-by-field-extra-method.tpl b/deploy/goctl/1.5.3/model/find-one-by-field-extra-method.tpl new file mode 100644 index 00000000..f6d695af --- /dev/null +++ b/deploy/goctl/1.5.3/model/find-one-by-field-extra-method.tpl @@ -0,0 +1,8 @@ +func (m *default{{.upperStartCamelObject}}Model) formatPrimary(primary interface{}) string { + return fmt.Sprintf("%s%v", {{.primaryKeyLeft}}, primary) +} + +func (m *default{{.upperStartCamelObject}}Model) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary interface{}) error { + query := fmt.Sprintf("select %s from %s where {{.originalPrimaryField}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table ) + return conn.QueryRowCtx(ctx, v, query, primary) +} diff --git a/deploy/goctl/1.5.3/model/find-one-by-field.tpl b/deploy/goctl/1.5.3/model/find-one-by-field.tpl new file mode 100644 index 00000000..226502d6 --- /dev/null +++ b/deploy/goctl/1.5.3/model/find-one-by-field.tpl @@ -0,0 +1,30 @@ +func (m *default{{.upperStartCamelObject}}Model) FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) { + {{if .withCache}}{{.cacheKey}} + var resp {{.upperStartCamelObject}} + err := m.QueryRowIndexCtx(ctx, &resp, {{.cacheKeyVariable}}, m.formatPrimary, func(ctx context.Context, conn sqlx.SqlConn, v interface{}) (i interface{}, e error) { + query := fmt.Sprintf("select %s from %s where {{.originalField}} limit 1", {{.lowerStartCamelObject}}Rows, m.table) + if err := conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelField}}); err != nil { + return nil, err + } + return resp.{{.upperStartCamelPrimaryKey}}, nil + }, m.queryPrimary) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +}{{else}}var resp {{.upperStartCamelObject}} + query := fmt.Sprintf("select %s from %s where {{.originalField}} limit 1", {{.lowerStartCamelObject}}Rows, m.table ) + err := m.conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelField}}) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +}{{end}} diff --git a/deploy/goctl/1.5.3/model/find-one.tpl b/deploy/goctl/1.5.3/model/find-one.tpl new file mode 100644 index 00000000..4e68b34d --- /dev/null +++ b/deploy/goctl/1.5.3/model/find-one.tpl @@ -0,0 +1,26 @@ +func (m *default{{.upperStartCamelObject}}Model) FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error) { + {{if .withCache}}{{.cacheKey}} + var resp {{.upperStartCamelObject}} + err := m.QueryRowCtx(ctx, &resp, {{.cacheKeyVariable}}, func(ctx context.Context, conn sqlx.SqlConn, v interface{}) error { + query := fmt.Sprintf("select %s from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table) + return conn.QueryRowCtx(ctx, v, query, {{.lowerStartCamelPrimaryKey}}) + }) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + }{{else}}query := fmt.Sprintf("select %s from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table) + var resp {{.upperStartCamelObject}} + err := m.conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelPrimaryKey}}) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + }{{end}} +} diff --git a/deploy/goctl/1.5.3/model/import-no-cache.tpl b/deploy/goctl/1.5.3/model/import-no-cache.tpl new file mode 100644 index 00000000..d99564e1 --- /dev/null +++ b/deploy/goctl/1.5.3/model/import-no-cache.tpl @@ -0,0 +1,13 @@ +import ( + "context" + "database/sql" + "fmt" + "strings" + {{if .time}}"time"{{end}} + + {{if .containsPQ}}"github.com/lib/pq"{{end}} + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) diff --git a/deploy/goctl/1.5.3/model/import.tpl b/deploy/goctl/1.5.3/model/import.tpl new file mode 100644 index 00000000..7e0c40f5 --- /dev/null +++ b/deploy/goctl/1.5.3/model/import.tpl @@ -0,0 +1,14 @@ +import ( + "context" + "database/sql" + "fmt" + "strings" + {{if .time}}"time"{{end}} + + {{if .containsPQ}}"github.com/lib/pq"{{end}} + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) diff --git a/deploy/goctl/1.5.3/model/insert.tpl b/deploy/goctl/1.5.3/model/insert.tpl new file mode 100644 index 00000000..08e02bce --- /dev/null +++ b/deploy/goctl/1.5.3/model/insert.tpl @@ -0,0 +1,9 @@ +func (m *default{{.upperStartCamelObject}}Model) Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error) { + {{if .withCache}}{{.keys}} + ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) + return conn.ExecCtx(ctx, query, {{.expressionValues}}) + }, {{.keyValues}}){{else}}query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) + ret,err:=m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}} + return ret,err +} diff --git a/deploy/goctl/1.5.3/model/interface-delete.tpl b/deploy/goctl/1.5.3/model/interface-delete.tpl new file mode 100644 index 00000000..d10978b9 --- /dev/null +++ b/deploy/goctl/1.5.3/model/interface-delete.tpl @@ -0,0 +1 @@ +Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/interface-find-one-by-field.tpl b/deploy/goctl/1.5.3/model/interface-find-one-by-field.tpl new file mode 100644 index 00000000..e18ded7a --- /dev/null +++ b/deploy/goctl/1.5.3/model/interface-find-one-by-field.tpl @@ -0,0 +1 @@ +FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/interface-find-one.tpl b/deploy/goctl/1.5.3/model/interface-find-one.tpl new file mode 100644 index 00000000..a7a54401 --- /dev/null +++ b/deploy/goctl/1.5.3/model/interface-find-one.tpl @@ -0,0 +1 @@ +FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error) \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/interface-insert.tpl b/deploy/goctl/1.5.3/model/interface-insert.tpl new file mode 100644 index 00000000..28724037 --- /dev/null +++ b/deploy/goctl/1.5.3/model/interface-insert.tpl @@ -0,0 +1 @@ +Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error) \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/interface-update.tpl b/deploy/goctl/1.5.3/model/interface-update.tpl new file mode 100644 index 00000000..1920425d --- /dev/null +++ b/deploy/goctl/1.5.3/model/interface-update.tpl @@ -0,0 +1 @@ +Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/model-gen.tpl b/deploy/goctl/1.5.3/model/model-gen.tpl new file mode 100644 index 00000000..cc3b5954 --- /dev/null +++ b/deploy/goctl/1.5.3/model/model-gen.tpl @@ -0,0 +1,13 @@ +// Code generated by goctl. DO NOT EDIT. + +package {{.pkg}} +{{.imports}} +{{.vars}} +{{.types}} +{{.new}} +{{.delete}} +{{.find}} +{{.insert}} +{{.update}} +{{.extraMethod}} +{{.tableName}} diff --git a/deploy/goctl/1.5.3/model/model-new.tpl b/deploy/goctl/1.5.3/model/model-new.tpl new file mode 100644 index 00000000..c73ab593 --- /dev/null +++ b/deploy/goctl/1.5.3/model/model-new.tpl @@ -0,0 +1,6 @@ +func new{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) *default{{.upperStartCamelObject}}Model { + return &default{{.upperStartCamelObject}}Model{ + {{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}}, + table: {{.table}}, + } +} diff --git a/deploy/goctl/1.5.3/model/model.tpl b/deploy/goctl/1.5.3/model/model.tpl new file mode 100644 index 00000000..2ca914a4 --- /dev/null +++ b/deploy/goctl/1.5.3/model/model.tpl @@ -0,0 +1,30 @@ +package {{.pkg}} +{{if .withCache}} +import ( + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) +{{else}} + +import "github.com/zeromicro/go-zero/core/stores/sqlx" +{{end}} +var _ {{.upperStartCamelObject}}Model = (*custom{{.upperStartCamelObject}}Model)(nil) + +type ( + // {{.upperStartCamelObject}}Model is an interface to be customized, add more methods here, + // and implement the added methods in custom{{.upperStartCamelObject}}Model. + {{.upperStartCamelObject}}Model interface { + {{.lowerStartCamelObject}}Model + } + + custom{{.upperStartCamelObject}}Model struct { + *default{{.upperStartCamelObject}}Model + } +) + +// New{{.upperStartCamelObject}}Model returns a model for the database table. +func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) {{.upperStartCamelObject}}Model { + return &custom{{.upperStartCamelObject}}Model{ + default{{.upperStartCamelObject}}Model: new{{.upperStartCamelObject}}Model(conn{{if .withCache}}, c{{end}}), + } +} diff --git a/deploy/goctl/1.5.3/model/table-name.tpl b/deploy/goctl/1.5.3/model/table-name.tpl new file mode 100644 index 00000000..8b14e33a --- /dev/null +++ b/deploy/goctl/1.5.3/model/table-name.tpl @@ -0,0 +1,3 @@ +func (m *default{{.upperStartCamelObject}}Model) tableName() string { + return m.table +} diff --git a/deploy/goctl/1.5.3/model/tag.tpl b/deploy/goctl/1.5.3/model/tag.tpl new file mode 100644 index 00000000..8e1ddf0d --- /dev/null +++ b/deploy/goctl/1.5.3/model/tag.tpl @@ -0,0 +1 @@ +`db:"{{.field}}"` \ No newline at end of file diff --git a/deploy/goctl/1.5.3/model/types.tpl b/deploy/goctl/1.5.3/model/types.tpl new file mode 100644 index 00000000..960cf2b3 --- /dev/null +++ b/deploy/goctl/1.5.3/model/types.tpl @@ -0,0 +1,14 @@ +type ( + {{.lowerStartCamelObject}}Model interface{ + {{.method}} + } + + default{{.upperStartCamelObject}}Model struct { + {{if .withCache}}sqlc.CachedConn{{else}}conn sqlx.SqlConn{{end}} + table string + } + + {{.upperStartCamelObject}} struct { + {{.fields}} + } +) diff --git a/deploy/goctl/1.5.3/model/update.tpl b/deploy/goctl/1.5.3/model/update.tpl new file mode 100644 index 00000000..41b9331c --- /dev/null +++ b/deploy/goctl/1.5.3/model/update.tpl @@ -0,0 +1,14 @@ +func (m *default{{.upperStartCamelObject}}Model) Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error { + {{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, newData.{{.upperStartCamelPrimaryKey}}) + if err!=nil{ + return err + } + +{{end}} {{.keys}} + _, {{if .containsIndexCache}}err{{else}}err:{{end}}= m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("update %s set %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table, {{.lowerStartCamelObject}}RowsWithPlaceHolder) + return conn.ExecCtx(ctx, query, {{.expressionValues}}) + }, {{.keyValues}}){{else}}query := fmt.Sprintf("update %s set %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table, {{.lowerStartCamelObject}}RowsWithPlaceHolder) + _,err:=m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}} + return err +} diff --git a/deploy/goctl/1.5.3/model/var.tpl b/deploy/goctl/1.5.3/model/var.tpl new file mode 100644 index 00000000..c11fe535 --- /dev/null +++ b/deploy/goctl/1.5.3/model/var.tpl @@ -0,0 +1,8 @@ +var ( +{{.lowerStartCamelObject}}FieldNames = builder.RawFieldNames(&{{.upperStartCamelObject}}{}{{if .postgreSql}}, true{{end}}) +{{.lowerStartCamelObject}}Rows = strings.Join({{.lowerStartCamelObject}}FieldNames, ",") +{{.lowerStartCamelObject}}RowsExpectAutoSet = {{if .postgreSql}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{end}} +{{.lowerStartCamelObject}}RowsWithPlaceHolder = {{if .postgreSql}}builder.PostgreSqlJoin(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}})){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}}), "=?,") + "=?"{{end}} + +{{if .withCache}}{{.cacheKeys}}{{end}} +) diff --git a/deploy/goctl/1.5.3/mongo/err.tpl b/deploy/goctl/1.5.3/mongo/err.tpl new file mode 100644 index 00000000..27d92449 --- /dev/null +++ b/deploy/goctl/1.5.3/mongo/err.tpl @@ -0,0 +1,12 @@ +package model + +import ( + "errors" + + "github.com/zeromicro/go-zero/core/stores/mon" +) + +var ( + ErrNotFound = mon.ErrNotFound + ErrInvalidObjectId = errors.New("invalid objectId") +) diff --git a/deploy/goctl/1.5.3/mongo/model.tpl b/deploy/goctl/1.5.3/mongo/model.tpl new file mode 100644 index 00000000..287125d9 --- /dev/null +++ b/deploy/goctl/1.5.3/mongo/model.tpl @@ -0,0 +1,78 @@ +// Code generated by goctl. DO NOT EDIT. +package model + +import ( + "context" + "time" + + {{if .Cache}}"github.com/zeromicro/go-zero/core/stores/monc"{{else}}"github.com/zeromicro/go-zero/core/stores/mon"{{end}} + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" +) + +{{if .Cache}}var prefix{{.Type}}CacheKey = "cache:{{.lowerType}}:"{{end}} + +type {{.lowerType}}Model interface{ + Insert(ctx context.Context,data *{{.Type}}) error + FindOne(ctx context.Context,id string) (*{{.Type}}, error) + Update(ctx context.Context,data *{{.Type}}) (*mongo.UpdateResult, error) + Delete(ctx context.Context,id string) (int64, error) +} + +type default{{.Type}}Model struct { + conn {{if .Cache}}*monc.Model{{else}}*mon.Model{{end}} +} + +func newDefault{{.Type}}Model(conn {{if .Cache}}*monc.Model{{else}}*mon.Model{{end}}) *default{{.Type}}Model { + return &default{{.Type}}Model{conn: conn} +} + + +func (m *default{{.Type}}Model) Insert(ctx context.Context, data *{{.Type}}) error { + if data.ID.IsZero() { + data.ID = primitive.NewObjectID() + data.CreateAt = time.Now() + data.UpdateAt = time.Now() + } + + {{if .Cache}}key := prefix{{.Type}}CacheKey + data.ID.Hex(){{end}} + _, err := m.conn.InsertOne(ctx, {{if .Cache}}key, {{end}} data) + return err +} + +func (m *default{{.Type}}Model) FindOne(ctx context.Context, id string) (*{{.Type}}, error) { + oid, err := primitive.ObjectIDFromHex(id) + if err != nil { + return nil, ErrInvalidObjectId + } + + var data {{.Type}} + {{if .Cache}}key := prefix{{.Type}}CacheKey + id{{end}} + err = m.conn.FindOne(ctx, {{if .Cache}}key, {{end}}&data, bson.M{"_id": oid}) + switch err { + case nil: + return &data, nil + case {{if .Cache}}monc{{else}}mon{{end}}.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *default{{.Type}}Model) Update(ctx context.Context, data *{{.Type}}) (*mongo.UpdateResult, error) { + data.UpdateAt = time.Now() + {{if .Cache}}key := prefix{{.Type}}CacheKey + data.ID.Hex(){{end}} + res, err := m.conn.UpdateOne(ctx, {{if .Cache}}key, {{end}}bson.M{"_id": data.ID}, bson.M{"$set": data}) + return res, err +} + +func (m *default{{.Type}}Model) Delete(ctx context.Context, id string) (int64, error) { + oid, err := primitive.ObjectIDFromHex(id) + if err != nil { + return 0, ErrInvalidObjectId + } + {{if .Cache}}key := prefix{{.Type}}CacheKey +id{{end}} + res, err := m.conn.DeleteOne(ctx, {{if .Cache}}key, {{end}}bson.M{"_id": oid}) + return res, err +} diff --git a/deploy/goctl/1.5.3/mongo/model_custom.tpl b/deploy/goctl/1.5.3/mongo/model_custom.tpl new file mode 100644 index 00000000..31fa8653 --- /dev/null +++ b/deploy/goctl/1.5.3/mongo/model_custom.tpl @@ -0,0 +1,38 @@ +package model + +{{if .Cache}}import ( + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/monc" +){{else}}import "github.com/zeromicro/go-zero/core/stores/mon"{{end}} + +{{if .Easy}} +const {{.Type}}CollectionName = "{{.snakeType}}" +{{end}} + +var _ {{.Type}}Model = (*custom{{.Type}}Model)(nil) + +type ( + // {{.Type}}Model is an interface to be customized, add more methods here, + // and implement the added methods in custom{{.Type}}Model. + {{.Type}}Model interface { + {{.lowerType}}Model + } + + custom{{.Type}}Model struct { + *default{{.Type}}Model + } +) + + +// New{{.Type}}Model returns a model for the mongo. +{{if .Easy}}func New{{.Type}}Model(url, db string{{if .Cache}}, c cache.CacheConf{{end}}) {{.Type}}Model { + conn := {{if .Cache}}monc{{else}}mon{{end}}.MustNewModel(url, db, {{.Type}}CollectionName{{if .Cache}}, c{{end}}) + return &custom{{.Type}}Model{ + default{{.Type}}Model: newDefault{{.Type}}Model(conn), + } +}{{else}}func New{{.Type}}Model(url, db, collection string{{if .Cache}}, c cache.CacheConf{{end}}) {{.Type}}Model { + conn := {{if .Cache}}monc{{else}}mon{{end}}.MustNewModel(url, db, collection{{if .Cache}}, c{{end}}) + return &custom{{.Type}}Model{ + default{{.Type}}Model: newDefault{{.Type}}Model(conn), + } +}{{end}} diff --git a/deploy/goctl/1.5.3/mongo/model_types.tpl b/deploy/goctl/1.5.3/mongo/model_types.tpl new file mode 100644 index 00000000..8da006f4 --- /dev/null +++ b/deploy/goctl/1.5.3/mongo/model_types.tpl @@ -0,0 +1,14 @@ +package model + +import ( + "time" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +type {{.Type}} struct { + ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` + // TODO: Fill your own fields + UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` + CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` +} diff --git a/deploy/goctl/1.5.3/newapi/newtemplate.tpl b/deploy/goctl/1.5.3/newapi/newtemplate.tpl new file mode 100644 index 00000000..28be5100 --- /dev/null +++ b/deploy/goctl/1.5.3/newapi/newtemplate.tpl @@ -0,0 +1,12 @@ +type Request { + Name string `path:"name,options=you|me"` +} + +type Response { + Message string `json:"message"` +} + +service {{.name}}-api { + @handler {{.handler}}Handler + get /from/:name(Request) returns (Response) +} diff --git a/deploy/goctl/1.5.3/rpc/call.tpl b/deploy/goctl/1.5.3/rpc/call.tpl new file mode 100644 index 00000000..27b48796 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/call.tpl @@ -0,0 +1,33 @@ +{{.head}} + +package {{.filePackage}} + +import ( + "context" + + {{.pbPackage}} + {{if ne .pbPackage .protoGoPackage}}{{.protoGoPackage}}{{end}} + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + {{.alias}} + + {{.serviceName}} interface { + {{.interface}} + } + + default{{.serviceName}} struct { + cli zrpc.Client + } +) + +func New{{.serviceName}}(cli zrpc.Client) {{.serviceName}} { + return &default{{.serviceName}}{ + cli: cli, + } +} + +{{.functions}} diff --git a/deploy/goctl/1.5.3/rpc/config.tpl b/deploy/goctl/1.5.3/rpc/config.tpl new file mode 100644 index 00000000..c1f85b99 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/config.tpl @@ -0,0 +1,7 @@ +package config + +import "github.com/zeromicro/go-zero/zrpc" + +type Config struct { + zrpc.RpcServerConf +} diff --git a/deploy/goctl/1.5.3/rpc/etc.tpl b/deploy/goctl/1.5.3/rpc/etc.tpl new file mode 100644 index 00000000..6cd4bddf --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/etc.tpl @@ -0,0 +1,6 @@ +Name: {{.serviceName}}.rpc +ListenOn: 0.0.0.0:8080 +Etcd: + Hosts: + - 127.0.0.1:2379 + Key: {{.serviceName}}.rpc diff --git a/deploy/goctl/1.5.3/rpc/logic-func.tpl b/deploy/goctl/1.5.3/rpc/logic-func.tpl new file mode 100644 index 00000000..e9410d41 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/logic-func.tpl @@ -0,0 +1,6 @@ +{{if .hasComment}}{{.comment}}{{end}} +func (l *{{.logicName}}) {{.method}} ({{if .hasReq}}in {{.request}}{{if .stream}},stream {{.streamBody}}{{end}}{{else}}stream {{.streamBody}}{{end}}) ({{if .hasReply}}{{.response}},{{end}} error) { + // todo: add your logic here and delete this line + + return {{if .hasReply}}&{{.responseType}}{},{{end}} nil +} diff --git a/deploy/goctl/1.5.3/rpc/logic.tpl b/deploy/goctl/1.5.3/rpc/logic.tpl new file mode 100644 index 00000000..b8d81f0b --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/logic.tpl @@ -0,0 +1,24 @@ +package {{.packageName}} + +import ( + "context" + + {{.imports}} + + "github.com/zeromicro/go-zero/core/logx" +) + +type {{.logicName}} struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func New{{.logicName}}(ctx context.Context,svcCtx *svc.ServiceContext) *{{.logicName}} { + return &{{.logicName}}{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} +{{.functions}} diff --git a/deploy/goctl/1.5.3/rpc/main.tpl b/deploy/goctl/1.5.3/rpc/main.tpl new file mode 100644 index 00000000..58cb6760 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/main.tpl @@ -0,0 +1,36 @@ +package main + +import ( + "flag" + "fmt" + + {{.imports}} + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/core/service" + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" +) + +var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + ctx := svc.NewServiceContext(c) + + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { +{{range .serviceNames}} {{.Pkg}}.Register{{.Service}}Server(grpcServer, {{.ServerPkg}}.New{{.Service}}Server(ctx)) +{{end}} + if c.Mode == service.DevMode || c.Mode == service.TestMode { + reflection.Register(grpcServer) + } + }) + defer s.Stop() + + fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) + s.Start() +} diff --git a/deploy/goctl/1.5.3/rpc/server-func.tpl b/deploy/goctl/1.5.3/rpc/server-func.tpl new file mode 100644 index 00000000..d771b438 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/server-func.tpl @@ -0,0 +1,6 @@ + +{{if .hasComment}}{{.comment}}{{end}} +func (s *{{.server}}Server) {{.method}} ({{if .notStream}}ctx context.Context,{{if .hasReq}} in {{.request}}{{end}}{{else}}{{if .hasReq}} in {{.request}},{{end}}stream {{.streamBody}}{{end}}) ({{if .notStream}}{{.response}},{{end}}error) { + l := {{.logicPkg}}.New{{.logicName}}({{if .notStream}}ctx,{{else}}stream.Context(),{{end}}s.svcCtx) + return l.{{.method}}({{if .hasReq}}in{{if .stream}} ,stream{{end}}{{else}}{{if .stream}}stream{{end}}{{end}}) +} diff --git a/deploy/goctl/1.5.3/rpc/server.tpl b/deploy/goctl/1.5.3/rpc/server.tpl new file mode 100644 index 00000000..84a2f9c1 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/server.tpl @@ -0,0 +1,22 @@ +{{.head}} + +package server + +import ( + {{if .notStream}}"context"{{end}} + + {{.imports}} +) + +type {{.server}}Server struct { + svcCtx *svc.ServiceContext + {{.unimplementedServer}} +} + +func New{{.server}}Server(svcCtx *svc.ServiceContext) *{{.server}}Server { + return &{{.server}}Server{ + svcCtx: svcCtx, + } +} + +{{.funcs}} diff --git a/deploy/goctl/1.5.3/rpc/svc.tpl b/deploy/goctl/1.5.3/rpc/svc.tpl new file mode 100644 index 00000000..cf2b47af --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/svc.tpl @@ -0,0 +1,13 @@ +package svc + +import {{.imports}} + +type ServiceContext struct { + Config config.Config +} + +func NewServiceContext(c config.Config) *ServiceContext { + return &ServiceContext{ + Config:c, + } +} diff --git a/deploy/goctl/1.5.3/rpc/template.tpl b/deploy/goctl/1.5.3/rpc/template.tpl new file mode 100644 index 00000000..76daa944 --- /dev/null +++ b/deploy/goctl/1.5.3/rpc/template.tpl @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package {{.package}}; +option go_package="./{{.package}}"; + +message Request { + string ping = 1; +} + +message Response { + string pong = 1; +} + +service {{.serviceName}} { + rpc Ping(Request) returns(Response); +} diff --git a/go.mod b/go.mod index 197855c0..4a9fdfd1 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20230714013255-149a9b428b28 gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714012611-c66005610d0c gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714015940-004100bfa168 - gitlink.org.cn/jcce-pcm/utils v0.0.1 + gitlink.org.cn/jcce-pcm/utils v0.0.0-20230724072501-2a0519bd57bd google.golang.org/grpc v1.56.2 google.golang.org/protobuf v1.31.0 gorm.io/driver/mysql v1.5.1 @@ -34,6 +34,7 @@ require ( github.com/aliyun/alibaba-cloud-sdk-go v1.61.1704 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect + github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect diff --git a/go.sum b/go.sum index 176eb454..46dcc0c3 100644 --- a/go.sum +++ b/go.sum @@ -444,6 +444,8 @@ github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwj github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= +github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= @@ -1035,8 +1037,8 @@ gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714012611-c66005610d gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20230714012611-c66005610d0c/go.mod h1:9Ad9vxCPGbY1yF1NhHWL2EhxsXJBB6bzz9i7PeSfKG4= gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714015940-004100bfa168 h1:BgTVUqJMOhdm6mNPx1ti5ClTnyMjZlCvH0avI1dz1xg= gitlink.org.cn/jcce-pcm/pcm-participant-slurm v0.0.0-20230714015940-004100bfa168/go.mod h1:lY3jXmmMvC7j4Q2ogliThURWp9c1XCToSCnRkdc1aW8= -gitlink.org.cn/jcce-pcm/utils v0.0.1 h1:3PH93Z/JFTH5JRO9MFf3dD1Gnd12aGiIIViWBlQGuhE= -gitlink.org.cn/jcce-pcm/utils v0.0.1/go.mod h1:5cwaaqM0+HK5GXVbYozGlWvgwoUby0KytdvhbwQW1ks= +gitlink.org.cn/jcce-pcm/utils v0.0.0-20230724072501-2a0519bd57bd h1:A9i6TPZ58OwycgWNQpIMrjSIMK8lXmmakig7IkonrVA= +gitlink.org.cn/jcce-pcm/utils v0.0.0-20230724072501-2a0519bd57bd/go.mod h1:zTa+selMe02jZ3u6Ij1rTF2CrGd2ZqzqyMQ/FwhdpvY= go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= go.etcd.io/etcd/api/v3 v3.5.9 h1:4wSsluwyTbGGmyjJktOf3wFQoTBIURXHnq9n/G/JQHs= diff --git a/model/scnodeavailinfomodel.go b/model/scnodeavailinfomodel.go index 4e7edcfb..c494655f 100755 --- a/model/scnodeavailinfomodel.go +++ b/model/scnodeavailinfomodel.go @@ -1,5 +1,12 @@ package model +import ( + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ ScNodeAvailInfoModel = (*customScNodeAvailInfoModel)(nil) + type ( // ScNodeAvailInfoModel is an interface to be customized, add more methods here, // and implement the added methods in customScNodeAvailInfoModel. @@ -11,3 +18,10 @@ type ( *defaultScNodeAvailInfoModel } ) + +// NewScNodeAvailInfoModel returns a model for the database table. +func NewScNodeAvailInfoModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) ScNodeAvailInfoModel { + return &customScNodeAvailInfoModel{ + defaultScNodeAvailInfoModel: newScNodeAvailInfoModel(conn, c, opts...), + } +} diff --git a/model/scnodeavailinfomodel_gen.go b/model/scnodeavailinfomodel_gen.go index b9c73787..f4e637f1 100755 --- a/model/scnodeavailinfomodel_gen.go +++ b/model/scnodeavailinfomodel_gen.go @@ -5,6 +5,7 @@ package model import ( "context" "database/sql" + "fmt" "strings" "time" @@ -38,22 +39,22 @@ type ( } ScNodeAvailInfo struct { - Id int64 `db:"id"` // id - NodeName string `db:"node_name"` // 节点名称 - CpuTotal int64 `db:"cpu_total"` // cpu核数 - CpuUsable float64 `db:"cpu_usable"` // cpu可用率 - DiskTotal int64 `db:"disk_total"` // 磁盘空间 - DiskAvail int64 `db:"disk_avail"` // 磁盘可用空间 - MemTotal int64 `db:"mem_total"` // 内存总数 - MemAvail int64 `db:"mem_avail"` // 内存可用数 - GpuTotal int64 `db:"gpu_total"` // gpu总数 - GpuAvail int64 `db:"gpu_avail"` // gpu可用数 - ParticipantId int64 `db:"participant_id"` // 集群静态信息id - DeletedFlag int64 `db:"deleted_flag"` // 是否删除 - CreatedBy int64 `db:"created_by"` // 创建人 - CreatedTime time.Time `db:"created_time"` // 创建时间 - UpdatedBy int64 `db:"updated_by"` // 更新人 - UpdatedTime time.Time `db:"updated_time"` // 更新时间 + Id int64 `db:"id"` // id + NodeName sql.NullString `db:"node_name"` // 节点名称 + CpuTotal sql.NullInt64 `db:"cpu_total"` // cpu核数 + CpuUsable sql.NullFloat64 `db:"cpu_usable"` // cpu可用率 + DiskTotal sql.NullInt64 `db:"disk_total"` // 磁盘空间 + DiskAvail sql.NullInt64 `db:"disk_avail"` // 磁盘可用空间 + MemTotal sql.NullInt64 `db:"mem_total"` // 内存总数 + MemAvail sql.NullInt64 `db:"mem_avail"` // 内存可用数 + GpuTotal sql.NullInt64 `db:"gpu_total"` // gpu总数 + GpuAvail sql.NullInt64 `db:"gpu_avail"` // gpu可用数 + ParticipantId int64 `db:"participant_id"` // 集群静态信息id + DeletedFlag int64 `db:"deleted_flag"` // 是否删除 + CreatedBy sql.NullInt64 `db:"created_by"` // 创建人 + CreatedTime time.Time `db:"created_time"` // 创建时间 + UpdatedBy sql.NullInt64 `db:"updated_by"` // 更新人 + UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间 } ) @@ -70,6 +71,60 @@ func (m *defaultScNodeAvailInfoModel) withSession(session sqlx.Session) *default table: "`sc_node_avail_info`", } } + +func (m *defaultScNodeAvailInfoModel) Delete(ctx context.Context, id int64) error { + pcmScNodeAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodeAvailInfoIdPrefix, id) + _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("delete from %s where `id` = ?", m.table) + return conn.ExecCtx(ctx, query, id) + }, pcmScNodeAvailInfoIdKey) + return err +} + +func (m *defaultScNodeAvailInfoModel) FindOne(ctx context.Context, id int64) (*ScNodeAvailInfo, error) { + pcmScNodeAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodeAvailInfoIdPrefix, id) + var resp ScNodeAvailInfo + err := m.QueryRowCtx(ctx, &resp, pcmScNodeAvailInfoIdKey, func(ctx context.Context, conn sqlx.SqlConn, v any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", scNodeAvailInfoRows, m.table) + return conn.QueryRowCtx(ctx, v, query, id) + }) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultScNodeAvailInfoModel) Insert(ctx context.Context, data *ScNodeAvailInfo) (sql.Result, error) { + pcmScNodeAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodeAvailInfoIdPrefix, data.Id) + ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, scNodeAvailInfoRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.Id, data.NodeName, data.CpuTotal, data.CpuUsable, data.DiskTotal, data.DiskAvail, data.MemTotal, data.MemAvail, data.GpuTotal, data.GpuAvail, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime) + }, pcmScNodeAvailInfoIdKey) + return ret, err +} + +func (m *defaultScNodeAvailInfoModel) Update(ctx context.Context, data *ScNodeAvailInfo) error { + pcmScNodeAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodeAvailInfoIdPrefix, data.Id) + _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, scNodeAvailInfoRowsWithPlaceHolder) + return conn.ExecCtx(ctx, query, data.NodeName, data.CpuTotal, data.CpuUsable, data.DiskTotal, data.DiskAvail, data.MemTotal, data.MemAvail, data.GpuTotal, data.GpuAvail, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime, data.Id) + }, pcmScNodeAvailInfoIdKey) + return err +} + +func (m *defaultScNodeAvailInfoModel) formatPrimary(primary any) string { + return fmt.Sprintf("%s%v", cachePcmScNodeAvailInfoIdPrefix, primary) +} + +func (m *defaultScNodeAvailInfoModel) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", scNodeAvailInfoRows, m.table) + return conn.QueryRowCtx(ctx, v, query, primary) +} + func (m *defaultScNodeAvailInfoModel) tableName() string { return m.table } diff --git a/model/scnodephyinfomodel.go b/model/scnodephyinfomodel.go index ded5bea4..97628778 100755 --- a/model/scnodephyinfomodel.go +++ b/model/scnodephyinfomodel.go @@ -1,5 +1,12 @@ package model +import ( + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ ScNodePhyInfoModel = (*customScNodePhyInfoModel)(nil) + type ( // ScNodePhyInfoModel is an interface to be customized, add more methods here, // and implement the added methods in customScNodePhyInfoModel. @@ -11,3 +18,10 @@ type ( *defaultScNodePhyInfoModel } ) + +// NewScNodePhyInfoModel returns a model for the database table. +func NewScNodePhyInfoModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) ScNodePhyInfoModel { + return &customScNodePhyInfoModel{ + defaultScNodePhyInfoModel: newScNodePhyInfoModel(conn, c, opts...), + } +} diff --git a/model/scnodephyinfomodel_gen.go b/model/scnodephyinfomodel_gen.go index e7dc76a7..83285c07 100755 --- a/model/scnodephyinfomodel_gen.go +++ b/model/scnodephyinfomodel_gen.go @@ -39,19 +39,19 @@ type ( } ScNodePhyInfo struct { - Id int64 `db:"id"` // id - NodeName string `db:"node_name"` // 节点名称 - OsName string `db:"os_name"` // 系统名称 - OsVersion int64 `db:"os_version"` // 系统版本 - ArchType string `db:"arch_type"` // 架构类型 - ArchName string `db:"arch_name"` // 架构名称 - ArchFreq string `db:"arch_freq"` // 架构频率 - ParticipantId int64 `db:"participant_id"` // 集群静态信息id - DeletedFlag int64 `db:"deleted_flag"` // 是否删除 - CreatedBy int64 `db:"created_by"` // 创建人 - CreatedTime time.Time `db:"created_time"` // 创建时间 - UpdatedBy int64 `db:"updated_by"` // 更新人 - UpdatedTime time.Time `db:"updated_time"` // 更新时间 + Id int64 `db:"id"` // id + NodeName string `db:"node_name"` // 节点名称 + OsName string `db:"os_name"` // 系统名称 + OsVersion int64 `db:"os_version"` // 系统版本 + ArchType string `db:"arch_type"` // 架构类型 + ArchName string `db:"arch_name"` // 架构名称 + ArchFreq string `db:"arch_freq"` // 架构频率 + ParticipantId int64 `db:"participant_id"` // 集群静态信息id + DeletedFlag int64 `db:"deleted_flag"` // 是否删除 + CreatedBy sql.NullInt64 `db:"created_by"` // 创建人 + CreatedTime time.Time `db:"created_time"` // 创建时间 + UpdatedBy sql.NullInt64 `db:"updated_by"` // 更新人 + UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间 } ) @@ -95,6 +95,33 @@ func (m *defaultScNodePhyInfoModel) FindOne(ctx context.Context, id int64) (*ScN } } +func (m *defaultScNodePhyInfoModel) Insert(ctx context.Context, data *ScNodePhyInfo) (sql.Result, error) { + pcmScNodePhyInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodePhyInfoIdPrefix, data.Id) + ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, scNodePhyInfoRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.Id, data.NodeName, data.OsName, data.OsVersion, data.ArchType, data.ArchName, data.ArchFreq, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime) + }, pcmScNodePhyInfoIdKey) + return ret, err +} + +func (m *defaultScNodePhyInfoModel) Update(ctx context.Context, data *ScNodePhyInfo) error { + pcmScNodePhyInfoIdKey := fmt.Sprintf("%s%v", cachePcmScNodePhyInfoIdPrefix, data.Id) + _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, scNodePhyInfoRowsWithPlaceHolder) + return conn.ExecCtx(ctx, query, data.NodeName, data.OsName, data.OsVersion, data.ArchType, data.ArchName, data.ArchFreq, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime, data.Id) + }, pcmScNodePhyInfoIdKey) + return err +} + +func (m *defaultScNodePhyInfoModel) formatPrimary(primary any) string { + return fmt.Sprintf("%s%v", cachePcmScNodePhyInfoIdPrefix, primary) +} + +func (m *defaultScNodePhyInfoModel) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", scNodePhyInfoRows, m.table) + return conn.QueryRowCtx(ctx, v, query, primary) +} + func (m *defaultScNodePhyInfoModel) tableName() string { return m.table } diff --git a/model/scparticipantavailinfomodel.go b/model/scparticipantavailinfomodel.go index db451b52..ea5b994f 100755 --- a/model/scparticipantavailinfomodel.go +++ b/model/scparticipantavailinfomodel.go @@ -1,5 +1,12 @@ package model +import ( + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ ScParticipantAvailInfoModel = (*customScParticipantAvailInfoModel)(nil) + type ( // ScParticipantAvailInfoModel is an interface to be customized, add more methods here, // and implement the added methods in customScParticipantAvailInfoModel. @@ -11,3 +18,10 @@ type ( *defaultScParticipantAvailInfoModel } ) + +// NewScParticipantAvailInfoModel returns a model for the database table. +func NewScParticipantAvailInfoModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) ScParticipantAvailInfoModel { + return &customScParticipantAvailInfoModel{ + defaultScParticipantAvailInfoModel: newScParticipantAvailInfoModel(conn, c, opts...), + } +} diff --git a/model/scparticipantavailinfomodel_gen.go b/model/scparticipantavailinfomodel_gen.go index 69dbbb9d..856db2ee 100755 --- a/model/scparticipantavailinfomodel_gen.go +++ b/model/scparticipantavailinfomodel_gen.go @@ -5,6 +5,7 @@ package model import ( "context" "database/sql" + "fmt" "strings" "time" @@ -38,19 +39,19 @@ type ( } ScParticipantAvailInfo struct { - Id int64 `db:"id"` // id - Host string `db:"host"` // 集群p端host - Port string `db:"port"` // 集群p端端口 - AvailStorageSpace int64 `db:"avail_storage_space"` // 集群存储可用空间 - UserNum int64 `db:"user_num"` // 用户数量 - PendingJobNum int64 `db:"pending_job_num"` // 待处理作业数量 - RunningJobNum int64 `db:"running_job_num"` // 运行作业数量 - ParticipantId int64 `db:"participant_id"` // 集群静态信息id - DeletedFlag int64 `db:"deleted_flag"` // 是否删除 - CreatedBy sql.NullInt64 `db:"created_by"` // 创建人 - CreatedTime time.Time `db:"created_time"` // 创建时间 - UpdatedBy sql.NullInt64 `db:"updated_by"` // 更新人 - UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间 + Id int64 `db:"id"` // id + Host sql.NullString `db:"host"` // 集群p端host + Port sql.NullString `db:"port"` // 集群p端端口 + AvailStorageSpace sql.NullInt64 `db:"avail_storage_space"` // 集群存储可用空间 + UserNum sql.NullInt64 `db:"user_num"` // 用户数量 + PendingJobNum sql.NullInt64 `db:"pending_job_num"` // 待处理作业数量 + RunningJobNum int64 `db:"running_job_num"` // 运行作业数量 + ParticipantId int64 `db:"participant_id"` // 集群静态信息id + DeletedFlag int64 `db:"deleted_flag"` // 是否删除 + CreatedBy sql.NullInt64 `db:"created_by"` // 创建人 + CreatedTime time.Time `db:"created_time"` // 创建时间 + UpdatedBy sql.NullInt64 `db:"updated_by"` // 更新人 + UpdatedTime sql.NullTime `db:"updated_time"` // 更新时间 } ) @@ -68,6 +69,59 @@ func (m *defaultScParticipantAvailInfoModel) withSession(session sqlx.Session) * } } +func (m *defaultScParticipantAvailInfoModel) Delete(ctx context.Context, id int64) error { + pcmScParticipantAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantAvailInfoIdPrefix, id) + _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("delete from %s where `id` = ?", m.table) + return conn.ExecCtx(ctx, query, id) + }, pcmScParticipantAvailInfoIdKey) + return err +} + +func (m *defaultScParticipantAvailInfoModel) FindOne(ctx context.Context, id int64) (*ScParticipantAvailInfo, error) { + pcmScParticipantAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantAvailInfoIdPrefix, id) + var resp ScParticipantAvailInfo + err := m.QueryRowCtx(ctx, &resp, pcmScParticipantAvailInfoIdKey, func(ctx context.Context, conn sqlx.SqlConn, v any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", scParticipantAvailInfoRows, m.table) + return conn.QueryRowCtx(ctx, v, query, id) + }) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultScParticipantAvailInfoModel) Insert(ctx context.Context, data *ScParticipantAvailInfo) (sql.Result, error) { + pcmScParticipantAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantAvailInfoIdPrefix, data.Id) + ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, scParticipantAvailInfoRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.Id, data.Host, data.Port, data.AvailStorageSpace, data.UserNum, data.PendingJobNum, data.RunningJobNum, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime) + }, pcmScParticipantAvailInfoIdKey) + return ret, err +} + +func (m *defaultScParticipantAvailInfoModel) Update(ctx context.Context, data *ScParticipantAvailInfo) error { + pcmScParticipantAvailInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantAvailInfoIdPrefix, data.Id) + _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, scParticipantAvailInfoRowsWithPlaceHolder) + return conn.ExecCtx(ctx, query, data.Host, data.Port, data.AvailStorageSpace, data.UserNum, data.PendingJobNum, data.RunningJobNum, data.ParticipantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime, data.Id) + }, pcmScParticipantAvailInfoIdKey) + return err +} + +func (m *defaultScParticipantAvailInfoModel) formatPrimary(primary any) string { + return fmt.Sprintf("%s%v", cachePcmScParticipantAvailInfoIdPrefix, primary) +} + +func (m *defaultScParticipantAvailInfoModel) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", scParticipantAvailInfoRows, m.table) + return conn.QueryRowCtx(ctx, v, query, primary) +} + func (m *defaultScParticipantAvailInfoModel) tableName() string { return m.table } diff --git a/model/scparticipantphyinfomodel_gen.go b/model/scparticipantphyinfomodel_gen.go index 199d6ed4..3bfefc37 100755 --- a/model/scparticipantphyinfomodel_gen.go +++ b/model/scparticipantphyinfomodel_gen.go @@ -40,6 +40,8 @@ type ( ScParticipantPhyInfo struct { Id int64 `db:"id"` // id + Host string `db:"host"` // 集群p端host + Port string `db:"port"` // 集群p端端口 NetworkType string `db:"network_type"` // 集群网络类型 NetworkBandwidth string `db:"network_bandwidth"` // 集群网络带宽 StorageType string `db:"storage_type"` // 集群存储类型 @@ -47,6 +49,7 @@ type ( StorageAvailSpace string `db:"storage_avail_space"` // 集群存储可用空间 StorageBandwidth string `db:"storage_bandwidth"` // 集群存储带宽 TenantId int64 `db:"tenant_id"` // 租户信息id + Type int64 `db:"type"` // 类型:0-数算集群;1-智算集群;2-超算集群 DeletedFlag int64 `db:"deleted_flag"` // 是否删除 CreatedBy sql.NullInt64 `db:"created_by"` // 创建人 CreatedTime time.Time `db:"created_time"` // 创建时间 @@ -98,8 +101,8 @@ func (m *defaultScParticipantPhyInfoModel) FindOne(ctx context.Context, id int64 func (m *defaultScParticipantPhyInfoModel) Insert(ctx context.Context, data *ScParticipantPhyInfo) (sql.Result, error) { pcmScParticipantPhyInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantPhyInfoIdPrefix, data.Id) ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { - query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, scParticipantPhyInfoRowsExpectAutoSet) - return conn.ExecCtx(ctx, query, data.Id, data.NetworkType, data.NetworkBandwidth, data.StorageType, data.StorageSpace, data.StorageAvailSpace, data.StorageBandwidth, data.TenantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime) + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, scParticipantPhyInfoRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.Id, data.Host, data.Port, data.NetworkType, data.NetworkBandwidth, data.StorageType, data.StorageSpace, data.StorageAvailSpace, data.StorageBandwidth, data.TenantId, data.Type, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime) }, pcmScParticipantPhyInfoIdKey) return ret, err } @@ -108,7 +111,7 @@ func (m *defaultScParticipantPhyInfoModel) Update(ctx context.Context, data *ScP pcmScParticipantPhyInfoIdKey := fmt.Sprintf("%s%v", cachePcmScParticipantPhyInfoIdPrefix, data.Id) _, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, scParticipantPhyInfoRowsWithPlaceHolder) - return conn.ExecCtx(ctx, query, data.NetworkType, data.NetworkBandwidth, data.StorageType, data.StorageSpace, data.StorageAvailSpace, data.StorageBandwidth, data.TenantId, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime, data.Id) + return conn.ExecCtx(ctx, query, data.Host, data.Port, data.NetworkType, data.NetworkBandwidth, data.StorageType, data.StorageSpace, data.StorageAvailSpace, data.StorageBandwidth, data.TenantId, data.Type, data.DeletedFlag, data.CreatedBy, data.CreatedTime, data.UpdatedBy, data.UpdatedTime, data.Id) }, pcmScParticipantPhyInfoIdKey) return err } diff --git a/rpc/Makefile b/rpc/Makefile new file mode 100644 index 00000000..eec8ebd1 --- /dev/null +++ b/rpc/Makefile @@ -0,0 +1,5 @@ +pcm-core-rpc: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pcm-core-rpc adaptor/PCM-CORE/rpc/pcmcore.go + +rpc-gen: + goctl rpc protoc pb/*.proto --go_out=. --go-grpc_out=. --zrpc_out=. -m \ No newline at end of file diff --git a/rpc/client/participantservice/participantservice.go b/rpc/client/participantservice/participantservice.go new file mode 100644 index 00000000..e91849e1 --- /dev/null +++ b/rpc/client/participantservice/participantservice.go @@ -0,0 +1,49 @@ +// Code generated by goctl. DO NOT EDIT. +// Source: pcmCore.proto + +package participantservice + +import ( + "context" + + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + AiInfo = pcmCore.AiInfo + CloudInfo = pcmCore.CloudInfo + HpcInfo = pcmCore.HpcInfo + InfoListReq = pcmCore.InfoListReq + InfoListResp = pcmCore.InfoListResp + NodeLabel = pcmCore.NodeLabel + NodePhyInfo = pcmCore.NodePhyInfo + ParticipantPhyReq = pcmCore.ParticipantPhyReq + ParticipantPhyResp = pcmCore.ParticipantPhyResp + ParticipantTenant = pcmCore.ParticipantTenant + SyncInfoReq = pcmCore.SyncInfoReq + SyncInfoResp = pcmCore.SyncInfoResp + + ParticipantService interface { + // registerParticipant Participant注册接口 + RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) + } + + defaultParticipantService struct { + cli zrpc.Client + } +) + +func NewParticipantService(cli zrpc.Client) ParticipantService { + return &defaultParticipantService{ + cli: cli, + } +} + +// registerParticipant Participant注册接口 +func (m *defaultParticipantService) RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) { + client := pcmCore.NewParticipantServiceClient(m.cli.Conn()) + return client.RegisterParticipant(ctx, in, opts...) +} diff --git a/rpc/pcmcoreclient/pcmcore.go b/rpc/client/pcmcore/pcmcore.go similarity index 67% rename from rpc/pcmcoreclient/pcmcore.go rename to rpc/client/pcmcore/pcmcore.go index bc3ba8ae..4dc65dba 100644 --- a/rpc/pcmcoreclient/pcmcore.go +++ b/rpc/client/pcmcore/pcmcore.go @@ -1,7 +1,7 @@ // Code generated by goctl. DO NOT EDIT. // Source: pcmCore.proto -package pcmcoreclient +package pcmcore import ( "context" @@ -13,13 +13,18 @@ import ( ) type ( - AiInfo = pcmCore.AiInfo - CloudInfo = pcmCore.CloudInfo - HpcInfo = pcmCore.HpcInfo - InfoListReq = pcmCore.InfoListReq - InfoListResp = pcmCore.InfoListResp - SyncInfoReq = pcmCore.SyncInfoReq - SyncInfoResp = pcmCore.SyncInfoResp + AiInfo = pcmCore.AiInfo + CloudInfo = pcmCore.CloudInfo + HpcInfo = pcmCore.HpcInfo + InfoListReq = pcmCore.InfoListReq + InfoListResp = pcmCore.InfoListResp + NodeLabel = pcmCore.NodeLabel + NodePhyInfo = pcmCore.NodePhyInfo + ParticipantPhyReq = pcmCore.ParticipantPhyReq + ParticipantPhyResp = pcmCore.ParticipantPhyResp + ParticipantTenant = pcmCore.ParticipantTenant + SyncInfoReq = pcmCore.SyncInfoReq + SyncInfoResp = pcmCore.SyncInfoResp PcmCore interface { // SyncInfo Synchronous data information diff --git a/rpc/etc/pcmcore.yaml b/rpc/etc/pcmcore.yaml index 9a8f8c2a..5f1389af 100644 --- a/rpc/etc/pcmcore.yaml +++ b/rpc/etc/pcmcore.yaml @@ -4,7 +4,7 @@ NacosConfig: ServerConfigs: # - IpAddr: 127.0.0.1 # Port: 8848 - - IpAddr: nacos.jcce.dev + - IpAddr: 10.101.15.7 Port: 8848 ClientConfig: NamespaceId: test diff --git a/rpc/internal/config/config.go b/rpc/internal/config/config.go index d4340de0..181cf928 100644 --- a/rpc/internal/config/config.go +++ b/rpc/internal/config/config.go @@ -10,5 +10,11 @@ type Config struct { DB struct { DataSource string } - LogConf logx.LogConf + LogConf logx.LogConf + SnowflakeConf SnowflakeConf +} + +// SnowflakeConf 雪花算法机器id配置 +type SnowflakeConf struct { + MachineId int64 `json:"machineId"` } diff --git a/rpc/internal/logic/participantservice/registerparticipantlogic.go b/rpc/internal/logic/participantservice/registerparticipantlogic.go new file mode 100644 index 00000000..c772c5a8 --- /dev/null +++ b/rpc/internal/logic/participantservice/registerparticipantlogic.go @@ -0,0 +1,71 @@ +package participantservicelogic + +import ( + "context" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/model" + "gitlink.org.cn/jcce-pcm/utils/tool" + "time" + + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RegisterParticipantLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewRegisterParticipantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RegisterParticipantLogic { + return &RegisterParticipantLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// RegisterParticipant Participant注册接口 +func (l *RegisterParticipantLogic) RegisterParticipant(in *pcmCore.ParticipantPhyReq) (*pcmCore.ParticipantPhyResp, error) { + //判断ParticipantId是否存在 + db := l.svcCtx.DbEngin + if db.Error != nil { + return nil, db.Error + } + participantInfo := &model.ScParticipantPhyInfo{} + tool.Convert(in, participantInfo) + if in.ParticipantId == 0 { + var err error + participantInfo.Id, err = tool.GenSnowflakeID(l.svcCtx.Config.SnowflakeConf.MachineId) + if err != nil { + logx.Errorf("生成id错误 err:", err) + } + } else { + participantInfo.Id = in.ParticipantId + } + participantInfo.CreatedTime = time.Now() + //保存participant静态信息 + result := db.Save(&participantInfo) + //保存节点信息 + nodeInfo := &model.ScNodePhyInfo{} + for _, info := range in.NodeInfo { + var err error + tool.Convert(info, nodeInfo) + nodeInfo.CreatedTime = time.Now() + nodeInfo.ParticipantId = participantInfo.Id + nodeInfo.Id, err = tool.GenSnowflakeID(l.svcCtx.Config.SnowflakeConf.MachineId) + if err != nil { + logx.Errorf("生成id错误 err:", err) + } + result = db.Save(nodeInfo) + if result.Error != nil { + logx.Errorf("orm err:", result.Error) + return &pcmCore.ParticipantPhyResp{}, nil + } + } + if result.Error != nil { + logx.Errorf("orm err:", result.Error) + } + return &pcmCore.ParticipantPhyResp{}, nil +} diff --git a/rpc/internal/logic/infolistlogic.go b/rpc/internal/logic/pcmcore/infolistlogic.go similarity index 98% rename from rpc/internal/logic/infolistlogic.go rename to rpc/internal/logic/pcmcore/infolistlogic.go index ad843f4c..0f8b2008 100644 --- a/rpc/internal/logic/infolistlogic.go +++ b/rpc/internal/logic/pcmcore/infolistlogic.go @@ -1,4 +1,4 @@ -package logic +package pcmcorelogic import ( "context" diff --git a/rpc/internal/logic/syncinfologic.go b/rpc/internal/logic/pcmcore/syncinfologic.go similarity index 99% rename from rpc/internal/logic/syncinfologic.go rename to rpc/internal/logic/pcmcore/syncinfologic.go index 52e52026..213e1655 100644 --- a/rpc/internal/logic/syncinfologic.go +++ b/rpc/internal/logic/pcmcore/syncinfologic.go @@ -1,4 +1,4 @@ -package logic +package pcmcorelogic import ( "context" diff --git a/rpc/internal/server/participantservice/participantserviceserver.go b/rpc/internal/server/participantservice/participantserviceserver.go new file mode 100644 index 00000000..f4c24f55 --- /dev/null +++ b/rpc/internal/server/participantservice/participantserviceserver.go @@ -0,0 +1,29 @@ +// Code generated by goctl. DO NOT EDIT. +// Source: pcmCore.proto + +package server + +import ( + "context" + + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/logic/participantservice" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" +) + +type ParticipantServiceServer struct { + svcCtx *svc.ServiceContext + pcmCore.UnimplementedParticipantServiceServer +} + +func NewParticipantServiceServer(svcCtx *svc.ServiceContext) *ParticipantServiceServer { + return &ParticipantServiceServer{ + svcCtx: svcCtx, + } +} + +// registerParticipant Participant注册接口 +func (s *ParticipantServiceServer) RegisterParticipant(ctx context.Context, in *pcmCore.ParticipantPhyReq) (*pcmCore.ParticipantPhyResp, error) { + l := participantservicelogic.NewRegisterParticipantLogic(ctx, s.svcCtx) + return l.RegisterParticipant(in) +} diff --git a/rpc/internal/server/pcmcoreserver.go b/rpc/internal/server/pcmcore/pcmcoreserver.go similarity index 81% rename from rpc/internal/server/pcmcoreserver.go rename to rpc/internal/server/pcmcore/pcmcoreserver.go index fa761155..58680bd0 100644 --- a/rpc/internal/server/pcmcoreserver.go +++ b/rpc/internal/server/pcmcore/pcmcoreserver.go @@ -6,7 +6,7 @@ package server import ( "context" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/logic" + "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/logic/pcmcore" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" ) @@ -24,12 +24,12 @@ func NewPcmCoreServer(svcCtx *svc.ServiceContext) *PcmCoreServer { // SyncInfo Synchronous data information func (s *PcmCoreServer) SyncInfo(ctx context.Context, in *pcmCore.SyncInfoReq) (*pcmCore.SyncInfoResp, error) { - l := logic.NewSyncInfoLogic(ctx, s.svcCtx) + l := pcmcorelogic.NewSyncInfoLogic(ctx, s.svcCtx) return l.SyncInfo(in) } // InfoList func (s *PcmCoreServer) InfoList(ctx context.Context, in *pcmCore.InfoListReq) (*pcmCore.InfoListResp, error) { - l := logic.NewInfoListLogic(ctx, s.svcCtx) + l := pcmcorelogic.NewInfoListLogic(ctx, s.svcCtx) return l.InfoList(in) } diff --git a/rpc/pb/pcmCore.proto b/rpc/pb/pcmCore.proto index b9b88db2..b6105ccd 100644 --- a/rpc/pb/pcmCore.proto +++ b/rpc/pb/pcmCore.proto @@ -20,13 +20,13 @@ message AiInfo { string startTime = 6; int64 runningTime = 7; string result = 8; - string jobId =9; + string jobId = 9; string createTime = 10; - string imageUrl =11; + string imageUrl = 11; string command = 12; - string flavorId =13; - string subscriptionId =14; - string itemVersionId =15; + string flavorId = 13; + string subscriptionId = 14; + string itemVersionId = 15; } message CloudInfo { @@ -57,13 +57,13 @@ message HpcInfo { string wallTime = 10; string cmdScript = 11; string derivedEs = 12; - string cluster =13; + string cluster = 13; string blockId = 14; uint32 allocNodes = 15; - uint32 allocCpu =16; + uint32 allocCpu = 16; string version = 17; - string account =18; - uint32 exitCode =19; + string account = 18; + uint32 exitCode = 19; uint32 assocId = 20; } @@ -84,7 +84,6 @@ message InfoListResp{ } - // pcm core services service pcmCore { @@ -93,5 +92,67 @@ service pcmCore { //InfoList rpc InfoList(InfoListReq) returns (InfoListResp); +} +// participantTenant 租户信息 +message participantTenant{ + string tenantName = 1; //租户名称 +} + +// 节点标签 +message NodeLabel { + string id = 1; //id + string label = 2; //标签名称 +} + +enum MessageStatus { + FAIL = 0; + SUCCESS = 1; + UNKNOWN = 2; +} + +message ParticipantPhyResp { + int64 code = 1; + string msg = 2; + string participantId = 3; //participant 唯一标识 +} + +//participantPhy 静态信息 +message ParticipantPhyReq { + string host = 2; //host + string port = 3; //端口号 + string networkType = 4; //集群网络类型 + string networkBandwidth = 5; //集群网络带宽 + string storageType = 6; //集群存储类型 + string storageSpace = 7; //集群存储空间 + string storageAvailSpace = 8; //集群存储可用空间 + string storageBandwidth = 9; //集群存储带宽 + string type = 10; //参与者类型:0-数算集群;1-智算集群;2-超算集群 + int64 tenantId = 11; //租户id + string tenantName = 12; //租户名称 + repeated NodePhyInfo nodeInfo = 13; //节点信息 + int64 participantId = 14; //participant id +} + +// nodePhyInfo 节点信息 +message NodePhyInfo { + string nodeName = 1; //节点名称 + string osName = 2; //系统名称 + string osVersion = 3; //系统版本 + string archType = 4; //架构类型 + string archName = 5; //架构名称 + string archFreq = 6; //架构频率 + repeated NodeLabel nodeLabel = 7; //节点标签 +} + +// participant 参与者 +service participantService { + // registerParticipant Participant注册接口 + rpc registerParticipant (ParticipantPhyReq) returns (ParticipantPhyResp) {}; +// //集群心跳 +// rpc reportHeartbeat (ClusterHeartbeatMessageProto) returns (MessageResponseProto) {}; +// //集群动态信息 +// rpc reportAvailResource (ClusterAvailResMessageProto) returns (MessageResponseProto) {}; +// //集群静态信息 +// rpc reportPhysicResource (ClusterPhyResMessageProto) returns (MessageResponseProto) {}; } \ No newline at end of file diff --git a/rpc/pcmCore/pcmCore.pb.go b/rpc/pcmCore/pcmCore.pb.go index c73de729..a68cd006 100644 --- a/rpc/pcmCore/pcmCore.pb.go +++ b/rpc/pcmCore/pcmCore.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v3.19.4 -// source: pcmCore.proto +// protoc v4.23.4 +// source: pb/pcmCore.proto package pcmCore @@ -20,6 +20,55 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type MessageStatus int32 + +const ( + MessageStatus_FAIL MessageStatus = 0 + MessageStatus_SUCCESS MessageStatus = 1 + MessageStatus_UNKNOWN MessageStatus = 2 +) + +// Enum value maps for MessageStatus. +var ( + MessageStatus_name = map[int32]string{ + 0: "FAIL", + 1: "SUCCESS", + 2: "UNKNOWN", + } + MessageStatus_value = map[string]int32{ + "FAIL": 0, + "SUCCESS": 1, + "UNKNOWN": 2, + } +) + +func (x MessageStatus) Enum() *MessageStatus { + p := new(MessageStatus) + *p = x + return p +} + +func (x MessageStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MessageStatus) Descriptor() protoreflect.EnumDescriptor { + return file_pb_pcmCore_proto_enumTypes[0].Descriptor() +} + +func (MessageStatus) Type() protoreflect.EnumType { + return &file_pb_pcmCore_proto_enumTypes[0] +} + +func (x MessageStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MessageStatus.Descriptor instead. +func (MessageStatus) EnumDescriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{0} +} + type SyncInfoReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -35,7 +84,7 @@ type SyncInfoReq struct { func (x *SyncInfoReq) Reset() { *x = SyncInfoReq{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[0] + mi := &file_pb_pcmCore_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +97,7 @@ func (x *SyncInfoReq) String() string { func (*SyncInfoReq) ProtoMessage() {} func (x *SyncInfoReq) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[0] + mi := &file_pb_pcmCore_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -61,7 +110,7 @@ func (x *SyncInfoReq) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncInfoReq.ProtoReflect.Descriptor instead. func (*SyncInfoReq) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{0} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{0} } func (x *SyncInfoReq) GetServiceName() string { @@ -124,7 +173,7 @@ type AiInfo struct { func (x *AiInfo) Reset() { *x = AiInfo{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[1] + mi := &file_pb_pcmCore_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -137,7 +186,7 @@ func (x *AiInfo) String() string { func (*AiInfo) ProtoMessage() {} func (x *AiInfo) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[1] + mi := &file_pb_pcmCore_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -150,7 +199,7 @@ func (x *AiInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use AiInfo.ProtoReflect.Descriptor instead. func (*AiInfo) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{1} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{1} } func (x *AiInfo) GetServiceName() string { @@ -279,7 +328,7 @@ type CloudInfo struct { func (x *CloudInfo) Reset() { *x = CloudInfo{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[2] + mi := &file_pb_pcmCore_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +341,7 @@ func (x *CloudInfo) String() string { func (*CloudInfo) ProtoMessage() {} func (x *CloudInfo) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[2] + mi := &file_pb_pcmCore_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,7 +354,7 @@ func (x *CloudInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CloudInfo.ProtoReflect.Descriptor instead. func (*CloudInfo) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{2} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{2} } func (x *CloudInfo) GetServiceName() string { @@ -415,7 +464,7 @@ type HpcInfo struct { func (x *HpcInfo) Reset() { *x = HpcInfo{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[3] + mi := &file_pb_pcmCore_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -428,7 +477,7 @@ func (x *HpcInfo) String() string { func (*HpcInfo) ProtoMessage() {} func (x *HpcInfo) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[3] + mi := &file_pb_pcmCore_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -441,7 +490,7 @@ func (x *HpcInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use HpcInfo.ProtoReflect.Descriptor instead. func (*HpcInfo) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{3} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{3} } func (x *HpcInfo) GetServiceName() string { @@ -596,7 +645,7 @@ type SyncInfoResp struct { func (x *SyncInfoResp) Reset() { *x = SyncInfoResp{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[4] + mi := &file_pb_pcmCore_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -609,7 +658,7 @@ func (x *SyncInfoResp) String() string { func (*SyncInfoResp) ProtoMessage() {} func (x *SyncInfoResp) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[4] + mi := &file_pb_pcmCore_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -622,7 +671,7 @@ func (x *SyncInfoResp) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncInfoResp.ProtoReflect.Descriptor instead. func (*SyncInfoResp) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{4} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{4} } func (x *SyncInfoResp) GetCode() int64 { @@ -651,7 +700,7 @@ type InfoListReq struct { func (x *InfoListReq) Reset() { *x = InfoListReq{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[5] + mi := &file_pb_pcmCore_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -664,7 +713,7 @@ func (x *InfoListReq) String() string { func (*InfoListReq) ProtoMessage() {} func (x *InfoListReq) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[5] + mi := &file_pb_pcmCore_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -677,7 +726,7 @@ func (x *InfoListReq) ProtoReflect() protoreflect.Message { // Deprecated: Use InfoListReq.ProtoReflect.Descriptor instead. func (*InfoListReq) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{5} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{5} } func (x *InfoListReq) GetKind() string { @@ -707,7 +756,7 @@ type InfoListResp struct { func (x *InfoListResp) Reset() { *x = InfoListResp{} if protoimpl.UnsafeEnabled { - mi := &file_pcmCore_proto_msgTypes[6] + mi := &file_pb_pcmCore_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -720,7 +769,7 @@ func (x *InfoListResp) String() string { func (*InfoListResp) ProtoMessage() {} func (x *InfoListResp) ProtoReflect() protoreflect.Message { - mi := &file_pcmCore_proto_msgTypes[6] + mi := &file_pb_pcmCore_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -733,7 +782,7 @@ func (x *InfoListResp) ProtoReflect() protoreflect.Message { // Deprecated: Use InfoListResp.ProtoReflect.Descriptor instead. func (*InfoListResp) Descriptor() ([]byte, []int) { - return file_pcmCore_proto_rawDescGZIP(), []int{6} + return file_pb_pcmCore_proto_rawDescGZIP(), []int{6} } func (x *InfoListResp) GetHpcInfoList() []*HpcInfo { @@ -757,185 +806,669 @@ func (x *InfoListResp) GetAiInfoList() []*AiInfo { return nil } -var File_pcmCore_proto protoreflect.FileDescriptor +// participantTenant 租户信息 +type ParticipantTenant struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var file_pcmCore_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x0b, 0x53, 0x79, 0x6e, - 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x32, - 0x0a, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x48, 0x70, - 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, - 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x63, 0x6d, 0x43, - 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, - 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x69, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xbb, 0x03, - 0x0a, 0x06, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, + TenantName string `protobuf:"bytes,1,opt,name=tenantName,proto3" json:"tenantName,omitempty"` //租户名称 +} + +func (x *ParticipantTenant) Reset() { + *x = ParticipantTenant{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParticipantTenant) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParticipantTenant) ProtoMessage() {} + +func (x *ParticipantTenant) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParticipantTenant.ProtoReflect.Descriptor instead. +func (*ParticipantTenant) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{7} +} + +func (x *ParticipantTenant) GetTenantName() string { + if x != nil { + return x.TenantName + } + return "" +} + +// 节点标签 +type NodeLabel struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` //id + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` //标签名称 +} + +func (x *NodeLabel) Reset() { + *x = NodeLabel{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeLabel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeLabel) ProtoMessage() {} + +func (x *NodeLabel) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeLabel.ProtoReflect.Descriptor instead. +func (*NodeLabel) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{8} +} + +func (x *NodeLabel) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *NodeLabel) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +type ParticipantPhyResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + ParticipantId string `protobuf:"bytes,3,opt,name=participantId,proto3" json:"participantId,omitempty"` //participant 唯一标识 +} + +func (x *ParticipantPhyResp) Reset() { + *x = ParticipantPhyResp{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParticipantPhyResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParticipantPhyResp) ProtoMessage() {} + +func (x *ParticipantPhyResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParticipantPhyResp.ProtoReflect.Descriptor instead. +func (*ParticipantPhyResp) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{9} +} + +func (x *ParticipantPhyResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ParticipantPhyResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *ParticipantPhyResp) GetParticipantId() string { + if x != nil { + return x.ParticipantId + } + return "" +} + +// participantPhy 静态信息 +type ParticipantPhyReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` //host + Port string `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"` //端口号 + NetworkType string `protobuf:"bytes,4,opt,name=networkType,proto3" json:"networkType,omitempty"` //集群网络类型 + NetworkBandwidth string `protobuf:"bytes,5,opt,name=networkBandwidth,proto3" json:"networkBandwidth,omitempty"` //集群网络带宽 + StorageType string `protobuf:"bytes,6,opt,name=storageType,proto3" json:"storageType,omitempty"` //集群存储类型 + StorageSpace string `protobuf:"bytes,7,opt,name=storageSpace,proto3" json:"storageSpace,omitempty"` //集群存储空间 + StorageAvailSpace string `protobuf:"bytes,8,opt,name=storageAvailSpace,proto3" json:"storageAvailSpace,omitempty"` //集群存储可用空间 + StorageBandwidth string `protobuf:"bytes,9,opt,name=storageBandwidth,proto3" json:"storageBandwidth,omitempty"` //集群存储带宽 + Type string `protobuf:"bytes,10,opt,name=type,proto3" json:"type,omitempty"` //参与者类型:0-数算集群;1-智算集群;2-超算集群 + TenantId int64 `protobuf:"varint,11,opt,name=tenantId,proto3" json:"tenantId,omitempty"` //租户id + TenantName string `protobuf:"bytes,12,opt,name=tenantName,proto3" json:"tenantName,omitempty"` //租户名称 + NodeInfo []*NodePhyInfo `protobuf:"bytes,13,rep,name=nodeInfo,proto3" json:"nodeInfo,omitempty"` //节点信息 + ParticipantId int64 `protobuf:"varint,14,opt,name=participantId,proto3" json:"participantId,omitempty"` //participant id +} + +func (x *ParticipantPhyReq) Reset() { + *x = ParticipantPhyReq{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParticipantPhyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParticipantPhyReq) ProtoMessage() {} + +func (x *ParticipantPhyReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParticipantPhyReq.ProtoReflect.Descriptor instead. +func (*ParticipantPhyReq) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{10} +} + +func (x *ParticipantPhyReq) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *ParticipantPhyReq) GetPort() string { + if x != nil { + return x.Port + } + return "" +} + +func (x *ParticipantPhyReq) GetNetworkType() string { + if x != nil { + return x.NetworkType + } + return "" +} + +func (x *ParticipantPhyReq) GetNetworkBandwidth() string { + if x != nil { + return x.NetworkBandwidth + } + return "" +} + +func (x *ParticipantPhyReq) GetStorageType() string { + if x != nil { + return x.StorageType + } + return "" +} + +func (x *ParticipantPhyReq) GetStorageSpace() string { + if x != nil { + return x.StorageSpace + } + return "" +} + +func (x *ParticipantPhyReq) GetStorageAvailSpace() string { + if x != nil { + return x.StorageAvailSpace + } + return "" +} + +func (x *ParticipantPhyReq) GetStorageBandwidth() string { + if x != nil { + return x.StorageBandwidth + } + return "" +} + +func (x *ParticipantPhyReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ParticipantPhyReq) GetTenantId() int64 { + if x != nil { + return x.TenantId + } + return 0 +} + +func (x *ParticipantPhyReq) GetTenantName() string { + if x != nil { + return x.TenantName + } + return "" +} + +func (x *ParticipantPhyReq) GetNodeInfo() []*NodePhyInfo { + if x != nil { + return x.NodeInfo + } + return nil +} + +func (x *ParticipantPhyReq) GetParticipantId() int64 { + if x != nil { + return x.ParticipantId + } + return 0 +} + +// nodePhyInfo 节点信息 +type NodePhyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeName string `protobuf:"bytes,1,opt,name=nodeName,proto3" json:"nodeName,omitempty"` //节点名称 + OsName string `protobuf:"bytes,2,opt,name=osName,proto3" json:"osName,omitempty"` //系统名称 + OsVersion string `protobuf:"bytes,3,opt,name=osVersion,proto3" json:"osVersion,omitempty"` //系统版本 + ArchType string `protobuf:"bytes,4,opt,name=archType,proto3" json:"archType,omitempty"` //架构类型 + ArchName string `protobuf:"bytes,5,opt,name=archName,proto3" json:"archName,omitempty"` //架构名称 + ArchFreq string `protobuf:"bytes,6,opt,name=archFreq,proto3" json:"archFreq,omitempty"` //架构频率 + NodeLabel []*NodeLabel `protobuf:"bytes,7,rep,name=nodeLabel,proto3" json:"nodeLabel,omitempty"` //节点标签 +} + +func (x *NodePhyInfo) Reset() { + *x = NodePhyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_pcmCore_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodePhyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodePhyInfo) ProtoMessage() {} + +func (x *NodePhyInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_pcmCore_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodePhyInfo.ProtoReflect.Descriptor instead. +func (*NodePhyInfo) Descriptor() ([]byte, []int) { + return file_pb_pcmCore_proto_rawDescGZIP(), []int{11} +} + +func (x *NodePhyInfo) GetNodeName() string { + if x != nil { + return x.NodeName + } + return "" +} + +func (x *NodePhyInfo) GetOsName() string { + if x != nil { + return x.OsName + } + return "" +} + +func (x *NodePhyInfo) GetOsVersion() string { + if x != nil { + return x.OsVersion + } + return "" +} + +func (x *NodePhyInfo) GetArchType() string { + if x != nil { + return x.ArchType + } + return "" +} + +func (x *NodePhyInfo) GetArchName() string { + if x != nil { + return x.ArchName + } + return "" +} + +func (x *NodePhyInfo) GetArchFreq() string { + if x != nil { + return x.ArchFreq + } + return "" +} + +func (x *NodePhyInfo) GetNodeLabel() []*NodeLabel { + if x != nil { + return x.NodeLabel + } + return nil +} + +var File_pb_pcmCore_proto protoreflect.FileDescriptor + +var file_pb_pcmCore_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x62, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x0b, + 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x32, 0x0a, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, + 0x2e, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, + 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, + 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, + 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x2f, 0x0a, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x69, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, + 0x22, 0xbb, 0x03, 0x0a, 0x06, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6a, 0x6f, 0x62, 0x49, + 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x76, 0x6f, 0x72, 0x49, 0x64, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x6c, 0x61, 0x76, 0x6f, 0x72, 0x49, 0x64, + 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xbb, + 0x02, 0x0a, 0x09, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x79, 0x61, 0x6d, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x79, 0x61, 0x6d, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0xa9, 0x04, 0x0a, + 0x07, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, - 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6c, 0x61, 0x76, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x6c, 0x61, 0x76, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x26, 0x0a, - 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x74, 0x65, 0x6d, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x74, - 0x65, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xbb, 0x02, 0x0a, 0x09, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, - 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x79, 0x61, 0x6d, - 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x79, - 0x61, 0x6d, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0xa9, 0x04, 0x0a, 0x07, 0x48, 0x70, - 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x6f, 0x72, - 0x6b, 0x44, 0x69, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x6f, 0x72, 0x6b, - 0x44, 0x69, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x61, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x61, 0x6c, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x63, 0x6d, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x6d, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x45, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x45, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, - 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x64, 0x12, - 0x1e, 0x0a, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x43, 0x70, 0x75, 0x18, 0x10, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x43, 0x70, 0x75, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, - 0x73, 0x73, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x73, - 0x73, 0x6f, 0x63, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x43, 0x0a, 0x0b, 0x49, - 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x20, - 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0xad, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x32, 0x0a, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, - 0x2e, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, - 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, - 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, - 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x2f, 0x0a, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x69, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x32, 0x7b, 0x0a, 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, - 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, - 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, - 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x5a, - 0x08, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x6d, + 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x69, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, + 0x6f, 0x72, 0x6b, 0x44, 0x69, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x61, 0x6c, 0x6c, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x61, 0x6c, 0x6c, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6d, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6d, 0x64, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x45, 0x73, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x45, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x49, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x43, 0x70, 0x75, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x43, 0x70, 0x75, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x13, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x49, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x07, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x43, + 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x0c, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x0b, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x63, 0x6d, 0x43, + 0x6f, 0x72, 0x65, 0x2e, 0x48, 0x70, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x48, 0x70, 0x63, + 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, + 0x2e, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x41, 0x69, 0x49, 0x6e, 0x66, 0x6f, 0x4c, + 0x69, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x60, 0x0a, 0x12, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xd1, 0x03, + 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, + 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, + 0x10, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, + 0x2c, 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x53, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x0a, + 0x10, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x63, + 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x68, 0x79, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, + 0x64, 0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x68, 0x79, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x73, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x72, 0x63, 0x68, 0x46, 0x72, 0x65, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x72, 0x63, 0x68, 0x46, 0x72, 0x65, 0x71, 0x12, 0x30, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x63, 0x6d, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x09, + 0x6e, 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x2a, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, + 0x49, 0x4c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x32, 0x7b, + 0x0a, 0x07, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x53, 0x79, 0x6e, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, + 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x37, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, + 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x49, + 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0x66, 0x0a, 0x12, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x50, 0x0a, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x72, + 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, + 0x72, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, + 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x50, 0x68, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2f, 0x70, 0x63, 0x6d, 0x43, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_pcmCore_proto_rawDescOnce sync.Once - file_pcmCore_proto_rawDescData = file_pcmCore_proto_rawDesc + file_pb_pcmCore_proto_rawDescOnce sync.Once + file_pb_pcmCore_proto_rawDescData = file_pb_pcmCore_proto_rawDesc ) -func file_pcmCore_proto_rawDescGZIP() []byte { - file_pcmCore_proto_rawDescOnce.Do(func() { - file_pcmCore_proto_rawDescData = protoimpl.X.CompressGZIP(file_pcmCore_proto_rawDescData) +func file_pb_pcmCore_proto_rawDescGZIP() []byte { + file_pb_pcmCore_proto_rawDescOnce.Do(func() { + file_pb_pcmCore_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_pcmCore_proto_rawDescData) }) - return file_pcmCore_proto_rawDescData + return file_pb_pcmCore_proto_rawDescData } -var file_pcmCore_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_pcmCore_proto_goTypes = []interface{}{ - (*SyncInfoReq)(nil), // 0: pcmCore.SyncInfoReq - (*AiInfo)(nil), // 1: pcmCore.AiInfo - (*CloudInfo)(nil), // 2: pcmCore.CloudInfo - (*HpcInfo)(nil), // 3: pcmCore.HpcInfo - (*SyncInfoResp)(nil), // 4: pcmCore.SyncInfoResp - (*InfoListReq)(nil), // 5: pcmCore.InfoListReq - (*InfoListResp)(nil), // 6: pcmCore.InfoListResp +var file_pb_pcmCore_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_pb_pcmCore_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_pb_pcmCore_proto_goTypes = []interface{}{ + (MessageStatus)(0), // 0: pcmCore.MessageStatus + (*SyncInfoReq)(nil), // 1: pcmCore.SyncInfoReq + (*AiInfo)(nil), // 2: pcmCore.AiInfo + (*CloudInfo)(nil), // 3: pcmCore.CloudInfo + (*HpcInfo)(nil), // 4: pcmCore.HpcInfo + (*SyncInfoResp)(nil), // 5: pcmCore.SyncInfoResp + (*InfoListReq)(nil), // 6: pcmCore.InfoListReq + (*InfoListResp)(nil), // 7: pcmCore.InfoListResp + (*ParticipantTenant)(nil), // 8: pcmCore.participantTenant + (*NodeLabel)(nil), // 9: pcmCore.NodeLabel + (*ParticipantPhyResp)(nil), // 10: pcmCore.ParticipantPhyResp + (*ParticipantPhyReq)(nil), // 11: pcmCore.ParticipantPhyReq + (*NodePhyInfo)(nil), // 12: pcmCore.NodePhyInfo } -var file_pcmCore_proto_depIdxs = []int32{ - 3, // 0: pcmCore.SyncInfoReq.HpcInfoList:type_name -> pcmCore.HpcInfo - 2, // 1: pcmCore.SyncInfoReq.CloudInfoList:type_name -> pcmCore.CloudInfo - 1, // 2: pcmCore.SyncInfoReq.AiInfoList:type_name -> pcmCore.AiInfo - 3, // 3: pcmCore.InfoListResp.HpcInfoList:type_name -> pcmCore.HpcInfo - 2, // 4: pcmCore.InfoListResp.CloudInfoList:type_name -> pcmCore.CloudInfo - 1, // 5: pcmCore.InfoListResp.AiInfoList:type_name -> pcmCore.AiInfo - 0, // 6: pcmCore.pcmCore.SyncInfo:input_type -> pcmCore.SyncInfoReq - 5, // 7: pcmCore.pcmCore.InfoList:input_type -> pcmCore.InfoListReq - 4, // 8: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp - 6, // 9: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name +var file_pb_pcmCore_proto_depIdxs = []int32{ + 4, // 0: pcmCore.SyncInfoReq.HpcInfoList:type_name -> pcmCore.HpcInfo + 3, // 1: pcmCore.SyncInfoReq.CloudInfoList:type_name -> pcmCore.CloudInfo + 2, // 2: pcmCore.SyncInfoReq.AiInfoList:type_name -> pcmCore.AiInfo + 4, // 3: pcmCore.InfoListResp.HpcInfoList:type_name -> pcmCore.HpcInfo + 3, // 4: pcmCore.InfoListResp.CloudInfoList:type_name -> pcmCore.CloudInfo + 2, // 5: pcmCore.InfoListResp.AiInfoList:type_name -> pcmCore.AiInfo + 12, // 6: pcmCore.ParticipantPhyReq.nodeInfo:type_name -> pcmCore.NodePhyInfo + 9, // 7: pcmCore.NodePhyInfo.nodeLabel:type_name -> pcmCore.NodeLabel + 1, // 8: pcmCore.pcmCore.SyncInfo:input_type -> pcmCore.SyncInfoReq + 6, // 9: pcmCore.pcmCore.InfoList:input_type -> pcmCore.InfoListReq + 11, // 10: pcmCore.participantService.registerParticipant:input_type -> pcmCore.ParticipantPhyReq + 5, // 11: pcmCore.pcmCore.SyncInfo:output_type -> pcmCore.SyncInfoResp + 7, // 12: pcmCore.pcmCore.InfoList:output_type -> pcmCore.InfoListResp + 10, // 13: pcmCore.participantService.registerParticipant:output_type -> pcmCore.ParticipantPhyResp + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } -func init() { file_pcmCore_proto_init() } -func file_pcmCore_proto_init() { - if File_pcmCore_proto != nil { +func init() { file_pb_pcmCore_proto_init() } +func file_pb_pcmCore_proto_init() { + if File_pb_pcmCore_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_pcmCore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncInfoReq); i { case 0: return &v.state @@ -947,7 +1480,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AiInfo); i { case 0: return &v.state @@ -959,7 +1492,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CloudInfo); i { case 0: return &v.state @@ -971,7 +1504,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HpcInfo); i { case 0: return &v.state @@ -983,7 +1516,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SyncInfoResp); i { case 0: return &v.state @@ -995,7 +1528,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InfoListReq); i { case 0: return &v.state @@ -1007,7 +1540,7 @@ func file_pcmCore_proto_init() { return nil } } - file_pcmCore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pb_pcmCore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InfoListResp); i { case 0: return &v.state @@ -1019,23 +1552,84 @@ func file_pcmCore_proto_init() { return nil } } + file_pb_pcmCore_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParticipantTenant); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeLabel); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParticipantPhyResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParticipantPhyReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_pcmCore_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodePhyInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pcmCore_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, + RawDescriptor: file_pb_pcmCore_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, - GoTypes: file_pcmCore_proto_goTypes, - DependencyIndexes: file_pcmCore_proto_depIdxs, - MessageInfos: file_pcmCore_proto_msgTypes, + GoTypes: file_pb_pcmCore_proto_goTypes, + DependencyIndexes: file_pb_pcmCore_proto_depIdxs, + EnumInfos: file_pb_pcmCore_proto_enumTypes, + MessageInfos: file_pb_pcmCore_proto_msgTypes, }.Build() - File_pcmCore_proto = out.File - file_pcmCore_proto_rawDesc = nil - file_pcmCore_proto_goTypes = nil - file_pcmCore_proto_depIdxs = nil + File_pb_pcmCore_proto = out.File + file_pb_pcmCore_proto_rawDesc = nil + file_pb_pcmCore_proto_goTypes = nil + file_pb_pcmCore_proto_depIdxs = nil } diff --git a/rpc/pcmCore/pcmCore_grpc.pb.go b/rpc/pcmCore/pcmCore_grpc.pb.go index 41cadff9..ea17da58 100644 --- a/rpc/pcmCore/pcmCore_grpc.pb.go +++ b/rpc/pcmCore/pcmCore_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.22.2 -// source: pcmCore.proto +// - protoc v4.23.4 +// source: pb/pcmCore.proto package pcmCore @@ -146,5 +146,97 @@ var PcmCore_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "pcmCore.proto", + Metadata: "pb/pcmCore.proto", +} + +const ( + ParticipantService_RegisterParticipant_FullMethodName = "/pcmCore.participantService/registerParticipant" +) + +// ParticipantServiceClient is the client API for ParticipantService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ParticipantServiceClient interface { + // registerParticipant Participant注册接口 + RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) +} + +type participantServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewParticipantServiceClient(cc grpc.ClientConnInterface) ParticipantServiceClient { + return &participantServiceClient{cc} +} + +func (c *participantServiceClient) RegisterParticipant(ctx context.Context, in *ParticipantPhyReq, opts ...grpc.CallOption) (*ParticipantPhyResp, error) { + out := new(ParticipantPhyResp) + err := c.cc.Invoke(ctx, ParticipantService_RegisterParticipant_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ParticipantServiceServer is the server API for ParticipantService service. +// All implementations must embed UnimplementedParticipantServiceServer +// for forward compatibility +type ParticipantServiceServer interface { + // registerParticipant Participant注册接口 + RegisterParticipant(context.Context, *ParticipantPhyReq) (*ParticipantPhyResp, error) + mustEmbedUnimplementedParticipantServiceServer() +} + +// UnimplementedParticipantServiceServer must be embedded to have forward compatible implementations. +type UnimplementedParticipantServiceServer struct { +} + +func (UnimplementedParticipantServiceServer) RegisterParticipant(context.Context, *ParticipantPhyReq) (*ParticipantPhyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterParticipant not implemented") +} +func (UnimplementedParticipantServiceServer) mustEmbedUnimplementedParticipantServiceServer() {} + +// UnsafeParticipantServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ParticipantServiceServer will +// result in compilation errors. +type UnsafeParticipantServiceServer interface { + mustEmbedUnimplementedParticipantServiceServer() +} + +func RegisterParticipantServiceServer(s grpc.ServiceRegistrar, srv ParticipantServiceServer) { + s.RegisterService(&ParticipantService_ServiceDesc, srv) +} + +func _ParticipantService_RegisterParticipant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ParticipantPhyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ParticipantServiceServer).RegisterParticipant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ParticipantService_RegisterParticipant_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ParticipantServiceServer).RegisterParticipant(ctx, req.(*ParticipantPhyReq)) + } + return interceptor(ctx, in, info, handler) +} + +// ParticipantService_ServiceDesc is the grpc.ServiceDesc for ParticipantService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ParticipantService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pcmCore.participantService", + HandlerType: (*ParticipantServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "registerParticipant", + Handler: _ParticipantService_RegisterParticipant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pb/pcmCore.proto", } diff --git a/rpc/pcmcore.go b/rpc/pcmcore.go index ea9e8376..021a5ee3 100644 --- a/rpc/pcmcore.go +++ b/rpc/pcmcore.go @@ -8,7 +8,8 @@ import ( "github.com/zeromicro/go-zero/zrpc" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/config" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/logic" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server" + participantserviceServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/participantservice" + pcmcoreServer "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/server/pcmcore" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc" "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" "gitlink.org.cn/jcce-pcm/utils/interceptor/rpcserver" @@ -48,8 +49,8 @@ func main() { ctx := svc.NewServiceContext(c) s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { - pcmCore.RegisterPcmCoreServer(grpcServer, server.NewPcmCoreServer(ctx)) - + pcmCore.RegisterPcmCoreServer(grpcServer, pcmcoreServer.NewPcmCoreServer(ctx)) + pcmCore.RegisterParticipantServiceServer(grpcServer, participantserviceServer.NewParticipantServiceServer(ctx)) if c.Mode == service.DevMode || c.Mode == service.TestMode { reflection.Register(grpcServer) }