bilibili-backup/app/service/live/live_data/api/liverpc/v0/Message.liverpc.go

77 lines
2.0 KiB
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
// 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
}