init layout
This commit is contained in:
parent
5aec0a0895
commit
fb0ad62f0e
23
.gitignore
vendored
23
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
# ---> Go
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Mac OS X files
|
||||
*.DS_Store
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
@ -9,16 +8,22 @@
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
|
||||
.glide/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
# Dependency directories
|
||||
vendor/
|
||||
|
||||
bin/
|
||||
.idea
|
||||
.vscode
|
||||
.env
|
||||
tmp/
|
||||
|
||||
/pkgdash
|
||||
|
23
cmd/rest/server.go
Normal file
23
cmd/rest/server.go
Normal file
@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.unistack.org/micro/v4/logger"
|
||||
"go.unistack.org/unistack-org/pkgdash/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
svc, err := service.NewService(ctx)
|
||||
if err != nil {
|
||||
logger.Fatalf(ctx, "failed to create service: %v", err)
|
||||
}
|
||||
|
||||
// start server
|
||||
if err = svc.Run(); err != nil {
|
||||
logger.Fatal(ctx, err)
|
||||
}
|
||||
|
||||
}
|
24
config/config.go
Normal file
24
config/config.go
Normal file
@ -0,0 +1,24 @@
|
||||
package config
|
||||
|
||||
import service "go.unistack.org/cms-service"
|
||||
|
||||
type App struct {
|
||||
Address string `flag:"name=pkgdash.address,desc='listen address',default='127.0.0.1:8080'"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
App *App
|
||||
Storage *service.ConfigStorage
|
||||
Logger *service.ConfigLogger
|
||||
Service *service.ConfigService
|
||||
Core *service.ConfigCore
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
return &Config{
|
||||
Service: &service.ConfigService{
|
||||
Name: ServiceName,
|
||||
Version: ServiceVersion,
|
||||
},
|
||||
}
|
||||
}
|
6
config/variables.go
Normal file
6
config/variables.go
Normal file
@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
var (
|
||||
ServiceName = "pkgdash"
|
||||
ServiceVersion = "0.0.1"
|
||||
)
|
24
entities.go
24
entities.go
@ -1,24 +0,0 @@
|
||||
package main
|
||||
|
||||
type DBPackage struct {
|
||||
Name string `db:"name"` // service name, last component path
|
||||
URL string `db:"url"` // scm url
|
||||
Modules []int64 `db:"modules"` // parsed go.mod modules
|
||||
ID int64 `db:"id"` // package id
|
||||
Issues []int64 `db:"issues"` // issues list
|
||||
}
|
||||
|
||||
type DBModule struct {
|
||||
Name string `db:"name"` // module name
|
||||
Version string `db:"version"` // module
|
||||
ID int64 `db:"id"`
|
||||
Package int64 `db:"package"`
|
||||
}
|
||||
|
||||
type DBIssue struct {
|
||||
ID int64 `db:"id"`
|
||||
Package int64 `db:"package"`
|
||||
Modules []int64 `db:"modules"`
|
||||
Status int64 `db:"status"`
|
||||
Desc string `db:"desc"`
|
||||
}
|
47
go.mod
47
go.mod
@ -3,10 +3,18 @@ module go.unistack.org/unistack-org/pkgdash
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/envoyproxy/protoc-gen-validate v1.0.2
|
||||
github.com/go-git/go-git/v5 v5.8.1
|
||||
go.unistack.org/micro-codec-yaml/v4 v4.0.0
|
||||
go.unistack.org/micro-config-flag/v4 v4.0.2
|
||||
github.com/jackc/pgtype v1.14.0
|
||||
go.unistack.org/cms-service v0.0.1
|
||||
go.unistack.org/micro-config-flag/v4 v4.0.1
|
||||
go.unistack.org/micro-server-grpc/v3 v3.10.6
|
||||
go.unistack.org/micro-server-http/v3 v3.11.6
|
||||
go.unistack.org/micro/v3 v3.10.25
|
||||
go.unistack.org/micro/v4 v4.0.5
|
||||
golang.org/x/mod v0.12.0
|
||||
golang.org/x/sync v0.3.0
|
||||
google.golang.org/protobuf v1.31.0
|
||||
)
|
||||
|
||||
require (
|
||||
@ -15,26 +23,55 @@ require (
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect
|
||||
github.com/acomagu/bufpipe v1.0.4 // indirect
|
||||
github.com/cloudflare/circl v1.3.3 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
|
||||
github.com/go-git/go-billy/v5 v5.4.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/jackc/pgio v1.0.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
|
||||
github.com/jackc/pgx/v5 v5.3.1 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.18 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/sergi/go-diff v1.3.1 // indirect
|
||||
github.com/sijms/go-ora/v2 v2.6.7 // indirect
|
||||
github.com/skeema/knownhosts v1.2.0 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
go.unistack.org/micro-proto/v4 v4.0.1 // indirect
|
||||
go.unistack.org/cms-api-proto v0.0.5 // indirect
|
||||
go.unistack.org/micro-broker-service/v3 v3.8.2 // indirect
|
||||
go.unistack.org/micro-codec-yaml/v3 v3.10.0 // indirect
|
||||
go.unistack.org/micro-config-env/v3 v3.8.5 // indirect
|
||||
go.unistack.org/micro-config-file/v3 v3.8.3 // indirect
|
||||
go.unistack.org/micro-config-flag/v3 v3.8.9 // indirect
|
||||
go.unistack.org/micro-config-service/v3 v3.8.1 // indirect
|
||||
go.unistack.org/micro-proto/v3 v3.3.1 // indirect
|
||||
golang.org/x/crypto v0.11.0 // indirect
|
||||
golang.org/x/mod v0.12.0 // indirect
|
||||
golang.org/x/net v0.12.0 // indirect
|
||||
golang.org/x/sys v0.10.0 // indirect
|
||||
golang.org/x/text v0.11.0 // indirect
|
||||
golang.org/x/tools v0.11.0 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
|
||||
google.golang.org/grpc v1.57.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
lukechampine.com/uint128 v1.3.0 // indirect
|
||||
modernc.org/cc/v3 v3.40.0 // indirect
|
||||
modernc.org/ccgo/v3 v3.16.13 // indirect
|
||||
modernc.org/libc v1.22.3 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.5.0 // indirect
|
||||
modernc.org/opt v0.1.3 // indirect
|
||||
modernc.org/sqlite v1.21.0 // indirect
|
||||
modernc.org/strutil v1.1.3 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
||||
)
|
||||
|
53
handler/handlers.go
Normal file
53
handler/handlers.go
Normal file
@ -0,0 +1,53 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"go.unistack.org/unistack-org/pkgdash/proto/go_generate"
|
||||
|
||||
cmsstorage "go.unistack.org/cms-service/storage"
|
||||
"go.unistack.org/micro/v3"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/unistack-org/pkgdash/config"
|
||||
"golang.org/x/mod/sumdb/storage"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
//db *xorm.Engine
|
||||
|
||||
svc micro.Service
|
||||
store storage.Storage
|
||||
}
|
||||
|
||||
func (h *Handler) ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (h *Handler) UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (h *Handler) AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func NewHandler(svc micro.Service) *Handler {
|
||||
return &Handler{svc: svc}
|
||||
}
|
||||
|
||||
func (h *Handler) Init(ctx context.Context) error {
|
||||
store := cmsstorage.InterfaceFromContext(h.svc.Options().Context)
|
||||
if store == nil {
|
||||
return cmsstorage.ErrMissingStorage
|
||||
}
|
||||
st, ok := store.(storage.Storage)
|
||||
if !ok {
|
||||
return errors.New(config.ServiceName, "error init storage", 1)
|
||||
}
|
||||
|
||||
h.store = st
|
||||
|
||||
return nil
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"bufio"
|
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
10
main.go
10
main.go
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"go.unistack.org/unistack-org/pkgdash/internal"
|
||||
"io"
|
||||
"net/url"
|
||||
"os"
|
||||
@ -14,7 +15,6 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing/filemode"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
"github.com/go-git/go-git/v5/storage/memory"
|
||||
"github.com/jmoiron/sqlx"
|
||||
flagconfig "go.unistack.org/micro-config-flag/v4"
|
||||
"go.unistack.org/micro/v4/config"
|
||||
"go.unistack.org/micro/v4/logger"
|
||||
@ -101,12 +101,12 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
Updates(UpdateOptions{
|
||||
internal.Updates(internal.UpdateOptions{
|
||||
Pre: false,
|
||||
Major: false,
|
||||
Cached: false,
|
||||
Modules: mvs,
|
||||
OnUpdate: func(u Update) {
|
||||
OnUpdate: func(u internal.Update) {
|
||||
if u.Err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s: failed: %v\n", u.Module.Path, u.Err)
|
||||
} else {
|
||||
@ -152,8 +152,12 @@ func Direct(file *object.File) ([]module.Version, error) {
|
||||
return mods, nil
|
||||
}
|
||||
|
||||
/*
|
||||
func Periodic(ctx context.Context, db *sqlx.DB) error {
|
||||
|
||||
db.
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
37
models/entities.go
Normal file
37
models/entities.go
Normal file
@ -0,0 +1,37 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
_ "database/sql"
|
||||
"github.com/jackc/pgtype"
|
||||
)
|
||||
|
||||
type DBPackage struct {
|
||||
Name string `db:"name"` // service name, last component path
|
||||
URL string `db:"url"` // scm url
|
||||
Modules []DBModule `db:"modules"` // parsed go.mod modules
|
||||
ID int64 `db:"id"` // package id
|
||||
Issues []DBIssue `db:"issues"` // issues list
|
||||
}
|
||||
|
||||
type DBModule struct {
|
||||
Name string `db:"name"` // module name
|
||||
Version string `db:"version"` // module
|
||||
ID int64 `db:"id"`
|
||||
Package int64 `db:"package"`
|
||||
}
|
||||
|
||||
type DBIssue struct {
|
||||
ID int64 `db:"id"`
|
||||
Package int64 `db:"package"`
|
||||
Modules []int64 `db:"modules"`
|
||||
Status int64 `db:"status"`
|
||||
Desc string `db:"desc"`
|
||||
}
|
||||
|
||||
type DBComment struct {
|
||||
ID int64 `db:"id"`
|
||||
Package int64 `db:"package"`
|
||||
Text string `db:"value"`
|
||||
Created pgtype.Date `db:"created"`
|
||||
Updated pgtype.Date `db:"updated"`
|
||||
}
|
65
proto/dashboard.proto
Normal file
65
proto/dashboard.proto
Normal file
@ -0,0 +1,65 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package proto;
|
||||
|
||||
option go_package = "go.unistack.org/unistack-org/pkgdash/proto/go_generate;go_generate";
|
||||
|
||||
import "validate/validate.proto";
|
||||
|
||||
service DashboardService {
|
||||
rpc ListPackage(ListPackageReq) returns (ListPackageRsp) {};
|
||||
rpc UpdateInfo(UpdateInfoPackageRsp) returns (UpdateInfoPackageReq) {};
|
||||
rpc AddComment(CommentRsp) returns (CommentReq) {};
|
||||
};
|
||||
|
||||
message Package {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
string name = 2 [(validate.rules).string.min_len = 1];
|
||||
string url = 3 [(validate.rules).string.min_len = 1];
|
||||
repeated Module modules = 4;
|
||||
repeated Issue issues = 5;
|
||||
};
|
||||
|
||||
message Module {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
string name = 2 [(validate.rules).string.min_len = 1];
|
||||
string version = 3 [(validate.rules).string.min_len = 1];
|
||||
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
||||
}
|
||||
|
||||
message Issue {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
uint64 status = 2 [(validate.rules).uint64.gt = 0];
|
||||
string desc = 3 [(validate.rules).string.min_len = 1];
|
||||
uint64 package = 4 [(validate.rules).uint64.gt = 0];
|
||||
repeated uint64 modules = 5;
|
||||
}
|
||||
|
||||
message Comment {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
uint64 package = 2 [(validate.rules).uint64.gt = 0];
|
||||
string text = 3;
|
||||
uint64 created = 4 [(validate.rules).uint64.gt = 0];
|
||||
uint64 updated = 5 [(validate.rules).uint64.gt = 0];
|
||||
}
|
||||
|
||||
message ListPackageReq {}
|
||||
message ListPackageRsp{
|
||||
repeated Package packages = 1;
|
||||
}
|
||||
|
||||
message UpdateInfoPackageRsp {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
}
|
||||
message UpdateInfoPackageReq {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
}
|
||||
|
||||
message CommentRsp {
|
||||
uint64 idPackage = 1 [(validate.rules).uint64.gt = 0];
|
||||
string text = 2;
|
||||
}
|
||||
|
||||
message CommentReq {
|
||||
uint64 id = 1 [(validate.rules).uint64.gt = 0];
|
||||
}
|
8
proto/generate.go
Normal file
8
proto/generate.go
Normal file
@ -0,0 +1,8 @@
|
||||
//go:build ignore
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate"
|
||||
_ "go.unistack.org/micro-proto/v3"
|
||||
)
|
12
proto/generate.sh
Executable file
12
proto/generate.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
PROTO_ARGS=" \
|
||||
--proto_path=$(go list -f '{{ .Dir }}' -m github.com/envoyproxy/protoc-gen-validate) \
|
||||
--proto_path=$(go list -f '{{ .Dir }}' -m go.unistack.org/micro-proto/v3) \
|
||||
--go_out=paths=source_relative:go_generate \
|
||||
--go-micro_out=module=go.unistack.org/unistack-org/pkgdash/proto/go_generate,components=micro|grpc,standalone=true:./micro \
|
||||
--validate_out=paths=source_relative,lang=go:go_generate"
|
||||
|
||||
rm -rf micro go_generate
|
||||
mkdir -p micro go_generate
|
||||
protoc -I. $PROTO_ARGS ./*.proto
|
884
proto/go_generate/dashboard.pb.go
Normal file
884
proto/go_generate/dashboard.pb.go
Normal file
@ -0,0 +1,884 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.4
|
||||
// source: dashboard.proto
|
||||
|
||||
package go_generate
|
||||
|
||||
import (
|
||||
_ "github.com/envoyproxy/protoc-gen-validate/validate"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Package struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
|
||||
Modules []*Module `protobuf:"bytes,4,rep,name=modules,proto3" json:"modules,omitempty"`
|
||||
Issues []*Issue `protobuf:"bytes,5,rep,name=issues,proto3" json:"issues,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Package) Reset() {
|
||||
*x = Package{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Package) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Package) ProtoMessage() {}
|
||||
|
||||
func (x *Package) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[0]
|
||||
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 Package.ProtoReflect.Descriptor instead.
|
||||
func (*Package) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Package) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Package) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Package) GetUrl() string {
|
||||
if x != nil {
|
||||
return x.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Package) GetModules() []*Module {
|
||||
if x != nil {
|
||||
return x.Modules
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Package) GetIssues() []*Issue {
|
||||
if x != nil {
|
||||
return x.Issues
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Module struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
|
||||
Package uint64 `protobuf:"varint,4,opt,name=package,proto3" json:"package,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Module) Reset() {
|
||||
*x = Module{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Module) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Module) ProtoMessage() {}
|
||||
|
||||
func (x *Module) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[1]
|
||||
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 Module.ProtoReflect.Descriptor instead.
|
||||
func (*Module) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Module) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Module) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Module) GetVersion() string {
|
||||
if x != nil {
|
||||
return x.Version
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Module) GetPackage() uint64 {
|
||||
if x != nil {
|
||||
return x.Package
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Issue struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Status uint64 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
|
||||
Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
|
||||
Package uint64 `protobuf:"varint,4,opt,name=package,proto3" json:"package,omitempty"`
|
||||
Modules []uint64 `protobuf:"varint,5,rep,packed,name=modules,proto3" json:"modules,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Issue) Reset() {
|
||||
*x = Issue{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Issue) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Issue) ProtoMessage() {}
|
||||
|
||||
func (x *Issue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[2]
|
||||
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 Issue.ProtoReflect.Descriptor instead.
|
||||
func (*Issue) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Issue) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Issue) GetStatus() uint64 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Issue) GetDesc() string {
|
||||
if x != nil {
|
||||
return x.Desc
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Issue) GetPackage() uint64 {
|
||||
if x != nil {
|
||||
return x.Package
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Issue) GetModules() []uint64 {
|
||||
if x != nil {
|
||||
return x.Modules
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Comment struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Package uint64 `protobuf:"varint,2,opt,name=package,proto3" json:"package,omitempty"`
|
||||
Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
|
||||
Created uint64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
|
||||
Updated uint64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Comment) Reset() {
|
||||
*x = Comment{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Comment) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Comment) ProtoMessage() {}
|
||||
|
||||
func (x *Comment) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[3]
|
||||
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 Comment.ProtoReflect.Descriptor instead.
|
||||
func (*Comment) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Comment) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Comment) GetPackage() uint64 {
|
||||
if x != nil {
|
||||
return x.Package
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Comment) GetText() string {
|
||||
if x != nil {
|
||||
return x.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Comment) GetCreated() uint64 {
|
||||
if x != nil {
|
||||
return x.Created
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Comment) GetUpdated() uint64 {
|
||||
if x != nil {
|
||||
return x.Updated
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListPackageReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *ListPackageReq) Reset() {
|
||||
*x = ListPackageReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListPackageReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListPackageReq) ProtoMessage() {}
|
||||
|
||||
func (x *ListPackageReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[4]
|
||||
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 ListPackageReq.ProtoReflect.Descriptor instead.
|
||||
func (*ListPackageReq) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type ListPackageRsp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Packages []*Package `protobuf:"bytes,1,rep,name=packages,proto3" json:"packages,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListPackageRsp) Reset() {
|
||||
*x = ListPackageRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListPackageRsp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListPackageRsp) ProtoMessage() {}
|
||||
|
||||
func (x *ListPackageRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[5]
|
||||
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 ListPackageRsp.ProtoReflect.Descriptor instead.
|
||||
func (*ListPackageRsp) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ListPackageRsp) GetPackages() []*Package {
|
||||
if x != nil {
|
||||
return x.Packages
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateInfoPackageRsp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageRsp) Reset() {
|
||||
*x = UpdateInfoPackageRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageRsp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateInfoPackageRsp) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateInfoPackageRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_proto_msgTypes[6]
|
||||
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 UpdateInfoPackageRsp.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateInfoPackageRsp) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageRsp) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type UpdateInfoPackageReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageReq) Reset() {
|
||||
*x = UpdateInfoPackageReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*UpdateInfoPackageReq) ProtoMessage() {}
|
||||
|
||||
func (x *UpdateInfoPackageReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_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 UpdateInfoPackageReq.ProtoReflect.Descriptor instead.
|
||||
func (*UpdateInfoPackageReq) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *UpdateInfoPackageReq) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CommentRsp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
IdPackage uint64 `protobuf:"varint,1,opt,name=idPackage,proto3" json:"idPackage,omitempty"`
|
||||
Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CommentRsp) Reset() {
|
||||
*x = CommentRsp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommentRsp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommentRsp) ProtoMessage() {}
|
||||
|
||||
func (x *CommentRsp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_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 CommentRsp.ProtoReflect.Descriptor instead.
|
||||
func (*CommentRsp) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *CommentRsp) GetIdPackage() uint64 {
|
||||
if x != nil {
|
||||
return x.IdPackage
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CommentRsp) GetText() string {
|
||||
if x != nil {
|
||||
return x.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CommentReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CommentReq) Reset() {
|
||||
*x = CommentReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_dashboard_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CommentReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CommentReq) ProtoMessage() {}
|
||||
|
||||
func (x *CommentReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_dashboard_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 CommentReq.ProtoReflect.Descriptor instead.
|
||||
func (*CommentReq) Descriptor() ([]byte, []int) {
|
||||
return file_dashboard_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *CommentReq) GetId() uint64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_dashboard_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_dashboard_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
|
||||
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x07, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x17, 0x0a,
|
||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02,
|
||||
0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
|
||||
0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x27,
|
||||
0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07,
|
||||
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65,
|
||||
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x49, 0x73, 0x73, 0x75, 0x65, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x22, 0x84, 0x01,
|
||||
0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x02, 0x69,
|
||||
0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21,
|
||||
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x70, 0x61, 0x63,
|
||||
0x6b, 0x61, 0x67, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x05, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x17,
|
||||
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32,
|
||||
0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
|
||||
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00,
|
||||
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52,
|
||||
0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52,
|
||||
0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x64, 0x75,
|
||||
0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x17,
|
||||
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32,
|
||||
0x02, 0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61,
|
||||
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20,
|
||||
0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65,
|
||||
0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21,
|
||||
0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42,
|
||||
0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||
0x64, 0x12, 0x21, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x07, 0x75, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b,
|
||||
0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61,
|
||||
0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x08, 0x70, 0x61, 0x63, 0x6b,
|
||||
0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x08, 0x70, 0x61, 0x63, 0x6b,
|
||||
0x61, 0x67, 0x65, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x12, 0x17, 0x0a, 0x02,
|
||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20,
|
||||
0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2f, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a,
|
||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02,
|
||||
0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x52, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x09, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00,
|
||||
0x52, 0x09, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74,
|
||||
0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22,
|
||||
0x25, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a,
|
||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02,
|
||||
0x20, 0x00, 0x52, 0x02, 0x69, 0x64, 0x32, 0xd1, 0x01, 0x0a, 0x10, 0x44, 0x61, 0x73, 0x68, 0x62,
|
||||
0x6f, 0x61, 0x72, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65,
|
||||
0x71, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61,
|
||||
0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x73, 0x70, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0a, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61,
|
||||
0x67, 0x65, 0x52, 0x73, 0x70, 0x1a, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x70,
|
||||
0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52,
|
||||
0x65, 0x71, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65,
|
||||
0x6e, 0x74, 0x52, 0x73, 0x70, 0x1a, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x22, 0x00, 0x42, 0x44, 0x5a, 0x42, 0x67, 0x6f,
|
||||
0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x75, 0x6e,
|
||||
0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x6b, 0x67, 0x64, 0x61,
|
||||
0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65,
|
||||
0x72, 0x61, 0x74, 0x65, 0x3b, 0x67, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_dashboard_proto_rawDescOnce sync.Once
|
||||
file_dashboard_proto_rawDescData = file_dashboard_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_dashboard_proto_rawDescGZIP() []byte {
|
||||
file_dashboard_proto_rawDescOnce.Do(func() {
|
||||
file_dashboard_proto_rawDescData = protoimpl.X.CompressGZIP(file_dashboard_proto_rawDescData)
|
||||
})
|
||||
return file_dashboard_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_dashboard_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_dashboard_proto_goTypes = []interface{}{
|
||||
(*Package)(nil), // 0: proto.Package
|
||||
(*Module)(nil), // 1: proto.Module
|
||||
(*Issue)(nil), // 2: proto.Issue
|
||||
(*Comment)(nil), // 3: proto.Comment
|
||||
(*ListPackageReq)(nil), // 4: proto.ListPackageReq
|
||||
(*ListPackageRsp)(nil), // 5: proto.ListPackageRsp
|
||||
(*UpdateInfoPackageRsp)(nil), // 6: proto.UpdateInfoPackageRsp
|
||||
(*UpdateInfoPackageReq)(nil), // 7: proto.UpdateInfoPackageReq
|
||||
(*CommentRsp)(nil), // 8: proto.CommentRsp
|
||||
(*CommentReq)(nil), // 9: proto.CommentReq
|
||||
}
|
||||
var file_dashboard_proto_depIdxs = []int32{
|
||||
1, // 0: proto.Package.modules:type_name -> proto.Module
|
||||
2, // 1: proto.Package.issues:type_name -> proto.Issue
|
||||
0, // 2: proto.ListPackageRsp.packages:type_name -> proto.Package
|
||||
4, // 3: proto.DashboardService.ListPackage:input_type -> proto.ListPackageReq
|
||||
6, // 4: proto.DashboardService.UpdateInfo:input_type -> proto.UpdateInfoPackageRsp
|
||||
8, // 5: proto.DashboardService.AddComment:input_type -> proto.CommentRsp
|
||||
5, // 6: proto.DashboardService.ListPackage:output_type -> proto.ListPackageRsp
|
||||
7, // 7: proto.DashboardService.UpdateInfo:output_type -> proto.UpdateInfoPackageReq
|
||||
9, // 8: proto.DashboardService.AddComment:output_type -> proto.CommentReq
|
||||
6, // [6:9] is the sub-list for method output_type
|
||||
3, // [3:6] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_dashboard_proto_init() }
|
||||
func file_dashboard_proto_init() {
|
||||
if File_dashboard_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_dashboard_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Package); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Module); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Issue); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Comment); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListPackageReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListPackageRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UpdateInfoPackageRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UpdateInfoPackageReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommentRsp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_dashboard_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CommentReq); 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_dashboard_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 10,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_dashboard_proto_goTypes,
|
||||
DependencyIndexes: file_dashboard_proto_depIdxs,
|
||||
MessageInfos: file_dashboard_proto_msgTypes,
|
||||
}.Build()
|
||||
File_dashboard_proto = out.File
|
||||
file_dashboard_proto_rawDesc = nil
|
||||
file_dashboard_proto_goTypes = nil
|
||||
file_dashboard_proto_depIdxs = nil
|
||||
}
|
1345
proto/go_generate/dashboard.pb.validate.go
Normal file
1345
proto/go_generate/dashboard.pb.validate.go
Normal file
File diff suppressed because it is too large
Load Diff
33
proto/micro/dashboard_micro.pb.go
Normal file
33
proto/micro/dashboard_micro.pb.go
Normal file
@ -0,0 +1,33 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.3
|
||||
// - protoc v4.23.4
|
||||
// source: dashboard.proto
|
||||
|
||||
package go_generate
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
go_generate "go.unistack.org/unistack-org/pkgdash/proto/go_generate"
|
||||
)
|
||||
|
||||
var (
|
||||
DashboardServiceName = "DashboardService"
|
||||
)
|
||||
var (
|
||||
DashboardServiceServerEndpoints = []v3.EndpointMetadata{}
|
||||
)
|
||||
|
||||
type DashboardServiceClient interface {
|
||||
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, opts ...client.CallOption) (*go_generate.ListPackageRsp, error)
|
||||
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, opts ...client.CallOption) (*go_generate.UpdateInfoPackageReq, error)
|
||||
AddComment(ctx context.Context, req *go_generate.CommentRsp, opts ...client.CallOption) (*go_generate.CommentReq, error)
|
||||
}
|
||||
|
||||
type DashboardServiceServer interface {
|
||||
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error
|
||||
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error
|
||||
AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error
|
||||
}
|
78
proto/micro/dashboard_micro_grpc.pb.go
Normal file
78
proto/micro/dashboard_micro_grpc.pb.go
Normal file
@ -0,0 +1,78 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.3
|
||||
// source: dashboard.proto
|
||||
|
||||
package go_generate
|
||||
|
||||
import (
|
||||
context "context"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
go_generate "go.unistack.org/unistack-org/pkgdash/proto/go_generate"
|
||||
)
|
||||
|
||||
type dashboardServiceClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewDashboardServiceClient(name string, c client.Client) DashboardServiceClient {
|
||||
return &dashboardServiceClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *dashboardServiceClient) ListPackage(ctx context.Context, req *go_generate.ListPackageReq, opts ...client.CallOption) (*go_generate.ListPackageRsp, error) {
|
||||
rsp := &go_generate.ListPackageRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "DashboardService.ListPackage", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *dashboardServiceClient) UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, opts ...client.CallOption) (*go_generate.UpdateInfoPackageReq, error) {
|
||||
rsp := &go_generate.UpdateInfoPackageReq{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "DashboardService.UpdateInfo", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *dashboardServiceClient) AddComment(ctx context.Context, req *go_generate.CommentRsp, opts ...client.CallOption) (*go_generate.CommentReq, error) {
|
||||
rsp := &go_generate.CommentReq{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "DashboardService.AddComment", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
type dashboardServiceServer struct {
|
||||
DashboardServiceServer
|
||||
}
|
||||
|
||||
func (h *dashboardServiceServer) ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error {
|
||||
return h.DashboardServiceServer.ListPackage(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *dashboardServiceServer) UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error {
|
||||
return h.DashboardServiceServer.UpdateInfo(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *dashboardServiceServer) AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error {
|
||||
return h.DashboardServiceServer.AddComment(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterDashboardServiceServer(s server.Server, sh DashboardServiceServer, opts ...server.HandlerOption) error {
|
||||
type dashboardService interface {
|
||||
ListPackage(ctx context.Context, req *go_generate.ListPackageReq, rsp *go_generate.ListPackageRsp) error
|
||||
UpdateInfo(ctx context.Context, req *go_generate.UpdateInfoPackageRsp, rsp *go_generate.UpdateInfoPackageReq) error
|
||||
AddComment(ctx context.Context, req *go_generate.CommentRsp, rsp *go_generate.CommentReq) error
|
||||
}
|
||||
type DashboardService struct {
|
||||
dashboardService
|
||||
}
|
||||
h := &dashboardServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
return s.Handle(s.NewHandler(&DashboardService{h}, append(nopts, opts...)...))
|
||||
}
|
9
service/embed.go
Normal file
9
service/embed.go
Normal file
@ -0,0 +1,9 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
service "go.unistack.org/cms-service"
|
||||
)
|
||||
|
||||
func init() {
|
||||
service.RegisterService("pkgdash", NewService)
|
||||
}
|
105
service/service.go
Normal file
105
service/service.go
Normal file
@ -0,0 +1,105 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
intcfg "go.unistack.org/unistack-org/pkgdash/config"
|
||||
"go.unistack.org/unistack-org/pkgdash/handler"
|
||||
pbmicro "go.unistack.org/unistack-org/pkgdash/proto/micro"
|
||||
|
||||
cmsservice "go.unistack.org/cms-service"
|
||||
grpcsrv "go.unistack.org/micro-server-grpc/v3"
|
||||
"go.unistack.org/micro/v3"
|
||||
"go.unistack.org/micro/v3/config"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
microuter "go.unistack.org/micro/v3/router"
|
||||
"go.unistack.org/micro/v3/server"
|
||||
)
|
||||
|
||||
func NewService(ctx context.Context) (micro.Service, error) {
|
||||
var reg register.Register
|
||||
var router microuter.Router
|
||||
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
}
|
||||
|
||||
cfg := intcfg.NewConfig()
|
||||
cs := cmsservice.NewConfigLocal(cfg)
|
||||
|
||||
if r, ok := register.FromContext(ctx); ok && r != nil {
|
||||
reg = r
|
||||
} else {
|
||||
reg = register.NewRegister()
|
||||
}
|
||||
if r, ok := microuter.FromContext(ctx); ok && r != nil {
|
||||
router = r
|
||||
} else {
|
||||
router = microuter.NewRouter()
|
||||
}
|
||||
|
||||
mgsrv := grpcsrv.NewServer(
|
||||
server.Register(reg),
|
||||
)
|
||||
|
||||
svc := micro.NewService(
|
||||
micro.Server(mgsrv),
|
||||
micro.Register(reg),
|
||||
micro.Router(router),
|
||||
micro.Config(cs...),
|
||||
)
|
||||
|
||||
h := handler.NewHandler(svc)
|
||||
|
||||
if err := svc.Init(
|
||||
micro.AfterStart(func(_ context.Context) error {
|
||||
return h.Init(svc.Options().Context)
|
||||
}),
|
||||
micro.BeforeStart(func(ctx context.Context) error {
|
||||
if err := config.Load(ctx, cs, config.LoadOverride(true)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := config.Validate(ctx, cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := svc.Init(
|
||||
micro.Name(cfg.Service.Name),
|
||||
micro.Version(cfg.Service.Version),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := svc.Server("grpc").Init(
|
||||
server.Address(cfg.App.Address),
|
||||
server.Name(cfg.Service.Name),
|
||||
server.Version(cfg.Service.Version),
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}),
|
||||
micro.BeforeStart(func(_ context.Context) error {
|
||||
level := logger.InfoLevel
|
||||
if v, ok := cfg.Logger.Level[cfg.Service.Name]; ok {
|
||||
level = logger.ParseLevel(v)
|
||||
} else if v, ok := cfg.Logger.Level["all"]; ok {
|
||||
level = logger.ParseLevel(v)
|
||||
}
|
||||
log := logger.NewLogger(
|
||||
logger.WithLevel(level),
|
||||
logger.WithCallerSkipCount(3),
|
||||
)
|
||||
return svc.Init(micro.Logger(log))
|
||||
}),
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := pbmicro.RegisterDashboardServiceServer(mgsrv, h); err != nil {
|
||||
logger.Fatalf(ctx, "failed to register handler: %v", err)
|
||||
}
|
||||
|
||||
return svc, nil
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user