bilibili-backup/app/service/live/live_data/api/liverpc/v0/Message.liverpc.go
2019-04-22 02:59:20 +00:00

77 lines
2.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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
}