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.
79 lines
2.0 KiB
79 lines
2.0 KiB
// Code generated by protoc-gen-liverpc v0.1, DO NOT EDIT. |
|
// source: v1/Guard.proto |
|
|
|
/* |
|
Package v1 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: |
|
v1/Guard.proto |
|
v1/Note.proto |
|
v1/RoomAdmin.proto |
|
v1/UserSetting.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 |
|
// Imports only used by utility functions: |
|
|
|
// =============== |
|
// Guard Interface |
|
// =============== |
|
|
|
type Guard interface { |
|
// * 根据uid获取大航海信息 |
|
// |
|
GetByUidTargetId(context.Context, *GuardGetByUidTargetIdReq) (*GuardGetByUidTargetIdResp, error) |
|
|
|
// * 根据uid获取大航海信息 |
|
// |
|
GetByUid(context.Context, *GuardGetByUidReq) (*GuardGetByUidResp, error) |
|
} |
|
|
|
// ===================== |
|
// Guard Live Rpc Client |
|
// ===================== |
|
|
|
type guardRpcClient struct { |
|
client *liverpc.Client |
|
} |
|
|
|
// NewGuardRpcClient creates a Rpc client that implements the Guard interface. |
|
// It communicates using Rpc and can be configured with a custom HTTPClient. |
|
func NewGuardRpcClient(client *liverpc.Client) Guard { |
|
return &guardRpcClient{ |
|
client: client, |
|
} |
|
} |
|
|
|
func (c *guardRpcClient) GetByUidTargetId(ctx context.Context, in *GuardGetByUidTargetIdReq) (*GuardGetByUidTargetIdResp, error) { |
|
out := new(GuardGetByUidTargetIdResp) |
|
err := doRpcRequest(ctx, c.client, 1, "Guard.getByUidTargetId", in, out) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return out, nil |
|
} |
|
|
|
func (c *guardRpcClient) GetByUid(ctx context.Context, in *GuardGetByUidReq) (*GuardGetByUidResp, error) { |
|
out := new(GuardGetByUidResp) |
|
err := doRpcRequest(ctx, c.client, 1, "Guard.getByUid", 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 |
|
}
|
|
|