go-common/app/service/live/gift/api/liverpc/v0/Smalltv.liverpc.go
2019-04-22 18:49:16 +08:00

64 lines
1.6 KiB
Go

// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT.
// source: v0/Smalltv.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/Smalltv.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:
// =================
// Smalltv Interface
// =================
type Smalltv interface {
// * 开启抽奖的内部接口
// 返回的是广播的内容列表
Start(context.Context, *SmalltvStartReq) (*SmalltvStartResp, error)
}
// =======================
// Smalltv Live Rpc Client
// =======================
type smalltvRpcClient struct {
client *liverpc.Client
}
// NewSmalltvRpcClient creates a Rpc client that implements the Smalltv interface.
// It communicates using Rpc and can be configured with a custom HTTPClient.
func NewSmalltvRpcClient(client *liverpc.Client) Smalltv {
return &smalltvRpcClient{
client: client,
}
}
func (c *smalltvRpcClient) Start(ctx context.Context, in *SmalltvStartReq) (*SmalltvStartResp, error) {
out := new(SmalltvStartResp)
err := doRpcRequest(ctx, c.client, 0, "Smalltv.start", 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
}