You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT. |
|
// source: v1/Shield.proto |
|
|
|
package v1 |
|
|
|
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 |
|
|
|
// ================ |
|
// Shield Interface |
|
// ================ |
|
|
|
type Shield interface { |
|
// * 是否是屏蔽内容 |
|
// 用于房主启用过滤之后,查询弹幕内容是否命中关键字 |
|
IsShieldContent(context.Context, *ShieldIsShieldContentReq) (*ShieldIsShieldContentResp, error) |
|
} |
|
|
|
// ====================== |
|
// Shield Live Rpc Client |
|
// ====================== |
|
|
|
type shieldRpcClient struct { |
|
client *liverpc.Client |
|
} |
|
|
|
// NewShieldRpcClient creates a Rpc client that implements the Shield interface. |
|
// It communicates using Rpc and can be configured with a custom HTTPClient. |
|
func NewShieldRpcClient(client *liverpc.Client) Shield { |
|
return &shieldRpcClient{ |
|
client: client, |
|
} |
|
} |
|
|
|
func (c *shieldRpcClient) IsShieldContent(ctx context.Context, in *ShieldIsShieldContentReq) (*ShieldIsShieldContentResp, error) { |
|
out := new(ShieldIsShieldContentResp) |
|
err := doRpcRequest(ctx, c.client, 1, "Shield.is_shield_content", in, out) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
}
|
|
|