Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v0_proto",
srcs = ["Message.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "v0_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
importpath = "go-common/app/service/live/live_data/api/liverpc/v0",
proto = ":v0_proto",
tags = ["automanaged"],
deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["Message.liverpc.go"],
embed = [":v0_go_proto"],
importpath = "go-common/app/service/live/live_data/api/liverpc/v0",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/liverpc:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,76 @@
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/Message.proto
/*
Package v0 is a generated liverpc stub package.
This code was generated with go-common/app/tool/liverpc/protoc-gen-liverpc v0.1.
It is generated from these files:
v0/Message.proto
*/
package v0
import context "context"
import proto "github.com/golang/protobuf/proto"
import "go-common/library/net/rpc/liverpc"
var _ proto.Message // generate to suppress unused imports
// Imports only used by utility functions:
// =================
// Message Interface
// =================
type Message interface {
// * 监控队列: topicRoomStatusNotify-T
//
LiveNotify(context.Context, *MessageLiveNotifyReq) (*MessageLiveNotifyResp, error)
// * 监控队列: topicOneLiveRoomAreaChange-T
//
AreaNotify(context.Context, *MessageAreaNotifyReq) (*MessageAreaNotifyResp, error)
}
// =======================
// Message Live Rpc Client
// =======================
type messageRpcClient struct {
client *liverpc.Client
}
// NewMessageRpcClient creates a Rpc client that implements the Message interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewMessageRpcClient(client *liverpc.Client) Message {
return &messageRpcClient{
client: client,
}
}
func (c *messageRpcClient) LiveNotify(ctx context.Context, in *MessageLiveNotifyReq) (*MessageLiveNotifyResp, error) {
out := new(MessageLiveNotifyResp)
err := doRpcRequest(ctx, c.client, 0, "Message.liveNotify", in, out)
if err != nil {
return nil, err
}
return out, nil
}
func (c *messageRpcClient) AreaNotify(ctx context.Context, in *MessageAreaNotifyReq) (*MessageAreaNotifyResp, error) {
out := new(MessageAreaNotifyResp)
err := doRpcRequest(ctx, c.client, 0, "Message.areaNotify", in, out)
if err != nil {
return nil, err
}
return out, nil
}
// =====
// Utils
// =====
func doRpcRequest(ctx context.Context, client *liverpc.Client, version int, method string, in, out proto.Message) (err error) {
err = client.Call(ctx, version, method, in, out)
return
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,58 @@
syntax = "proto3";
package live_data.v0;
option go_package = "v0";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
service Message {
/** 监控队列: topicRoomStatusNotify-T
*
*/
rpc liveNotify (MessageLiveNotifyReq) returns (MessageLiveNotifyResp);
/** 监控队列: topicOneLiveRoomAreaChange-T
*
*/
rpc areaNotify (MessageAreaNotifyReq) returns (MessageAreaNotifyResp);
}
message MessageLiveNotifyReq {
}
message MessageLiveNotifyResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}
message MessageAreaNotifyReq {
}
message MessageAreaNotifyResp {
// code
int64 code = 1 [(gogoproto.jsontag) = "code"];
// msg
string msg = 2 [(gogoproto.jsontag) = "msg"];
//
Data data = 3 [(gogoproto.jsontag) = "data"];
message Data {
}
}