418 lines
17 KiB
Go
418 lines
17 KiB
Go
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-triple v1.0.5
|
|
// - protoc v3.9.0
|
|
// source: api/contract/contract.proto
|
|
|
|
package contract
|
|
|
|
import (
|
|
context "context"
|
|
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
|
|
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
|
|
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
|
|
grpc_go "github.com/dubbogo/grpc-go"
|
|
codes "github.com/dubbogo/grpc-go/codes"
|
|
metadata "github.com/dubbogo/grpc-go/metadata"
|
|
status "github.com/dubbogo/grpc-go/status"
|
|
common "github.com/dubbogo/triple/pkg/common"
|
|
constant "github.com/dubbogo/triple/pkg/common/constant"
|
|
triple "github.com/dubbogo/triple/pkg/triple"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc_go.SupportPackageIsVersion7
|
|
|
|
// ContractClient is the client API for Contract service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type ContractClient interface {
|
|
FinishContract(ctx context.Context, in *FinishContractRequest, opts ...grpc_go.CallOption) (*FinishContractRespond, common.ErrorWithAttachment)
|
|
ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment)
|
|
GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment)
|
|
ContractTxList(ctx context.Context, in *ContractTxListRequest, opts ...grpc_go.CallOption) (*ContractTxListRespond, common.ErrorWithAttachment)
|
|
SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment)
|
|
UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment)
|
|
UpdateContractTx(ctx context.Context, in *UpdateContractTxRequest, opts ...grpc_go.CallOption) (*UpdateContractTxRespond, common.ErrorWithAttachment)
|
|
}
|
|
|
|
type contractClient struct {
|
|
cc *triple.TripleConn
|
|
}
|
|
|
|
type ContractClientImpl struct {
|
|
FinishContract func(ctx context.Context, in *FinishContractRequest) (*FinishContractRespond, error)
|
|
ContractList func(ctx context.Context, in *ContractListRequest) (*ContractListRespond, error)
|
|
GetContract func(ctx context.Context, in *GetContractRequest) (*ContractData, error)
|
|
ContractTxList func(ctx context.Context, in *ContractTxListRequest) (*ContractTxListRespond, error)
|
|
SignContract func(ctx context.Context, in *SignContractRequest) (*SignContractRespond, error)
|
|
UpdateContract func(ctx context.Context, in *UpdateContractRequest) (*UpdateContractRespond, error)
|
|
UpdateContractTx func(ctx context.Context, in *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
|
}
|
|
|
|
func (c *ContractClientImpl) GetDubboStub(cc *triple.TripleConn) ContractClient {
|
|
return NewContractClient(cc)
|
|
}
|
|
|
|
func (c *ContractClientImpl) XXX_InterfaceName() string {
|
|
return "Contract.Contract"
|
|
}
|
|
|
|
func NewContractClient(cc *triple.TripleConn) ContractClient {
|
|
return &contractClient{cc}
|
|
}
|
|
|
|
func (c *contractClient) FinishContract(ctx context.Context, in *FinishContractRequest, opts ...grpc_go.CallOption) (*FinishContractRespond, common.ErrorWithAttachment) {
|
|
out := new(FinishContractRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/FinishContract", in, out)
|
|
}
|
|
|
|
func (c *contractClient) ContractList(ctx context.Context, in *ContractListRequest, opts ...grpc_go.CallOption) (*ContractListRespond, common.ErrorWithAttachment) {
|
|
out := new(ContractListRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractList", in, out)
|
|
}
|
|
|
|
func (c *contractClient) GetContract(ctx context.Context, in *GetContractRequest, opts ...grpc_go.CallOption) (*ContractData, common.ErrorWithAttachment) {
|
|
out := new(ContractData)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetContract", in, out)
|
|
}
|
|
|
|
func (c *contractClient) ContractTxList(ctx context.Context, in *ContractTxListRequest, opts ...grpc_go.CallOption) (*ContractTxListRespond, common.ErrorWithAttachment) {
|
|
out := new(ContractTxListRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ContractTxList", in, out)
|
|
}
|
|
|
|
func (c *contractClient) SignContract(ctx context.Context, in *SignContractRequest, opts ...grpc_go.CallOption) (*SignContractRespond, common.ErrorWithAttachment) {
|
|
out := new(SignContractRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SignContract", in, out)
|
|
}
|
|
|
|
func (c *contractClient) UpdateContract(ctx context.Context, in *UpdateContractRequest, opts ...grpc_go.CallOption) (*UpdateContractRespond, common.ErrorWithAttachment) {
|
|
out := new(UpdateContractRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateContract", in, out)
|
|
}
|
|
|
|
func (c *contractClient) UpdateContractTx(ctx context.Context, in *UpdateContractTxRequest, opts ...grpc_go.CallOption) (*UpdateContractTxRespond, common.ErrorWithAttachment) {
|
|
out := new(UpdateContractTxRespond)
|
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateContractTx", in, out)
|
|
}
|
|
|
|
// ContractServer is the server API for Contract service.
|
|
// All implementations must embed UnimplementedContractServer
|
|
// for forward compatibility
|
|
type ContractServer interface {
|
|
FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error)
|
|
ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error)
|
|
GetContract(context.Context, *GetContractRequest) (*ContractData, error)
|
|
ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error)
|
|
SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error)
|
|
UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error)
|
|
UpdateContractTx(context.Context, *UpdateContractTxRequest) (*UpdateContractTxRespond, error)
|
|
mustEmbedUnimplementedContractServer()
|
|
}
|
|
|
|
// UnimplementedContractServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedContractServer struct {
|
|
proxyImpl protocol.Invoker
|
|
}
|
|
|
|
func (UnimplementedContractServer) FinishContract(context.Context, *FinishContractRequest) (*FinishContractRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method FinishContract not implemented")
|
|
}
|
|
func (UnimplementedContractServer) ContractList(context.Context, *ContractListRequest) (*ContractListRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ContractList not implemented")
|
|
}
|
|
func (UnimplementedContractServer) GetContract(context.Context, *GetContractRequest) (*ContractData, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetContract not implemented")
|
|
}
|
|
func (UnimplementedContractServer) ContractTxList(context.Context, *ContractTxListRequest) (*ContractTxListRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ContractTxList not implemented")
|
|
}
|
|
func (UnimplementedContractServer) SignContract(context.Context, *SignContractRequest) (*SignContractRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SignContract not implemented")
|
|
}
|
|
func (UnimplementedContractServer) UpdateContract(context.Context, *UpdateContractRequest) (*UpdateContractRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateContract not implemented")
|
|
}
|
|
func (UnimplementedContractServer) UpdateContractTx(context.Context, *UpdateContractTxRequest) (*UpdateContractTxRespond, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateContractTx not implemented")
|
|
}
|
|
func (s *UnimplementedContractServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
|
s.proxyImpl = impl
|
|
}
|
|
|
|
func (s *UnimplementedContractServer) XXX_GetProxyImpl() protocol.Invoker {
|
|
return s.proxyImpl
|
|
}
|
|
|
|
func (s *UnimplementedContractServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
|
return &Contract_ServiceDesc
|
|
}
|
|
func (s *UnimplementedContractServer) XXX_InterfaceName() string {
|
|
return "Contract.Contract"
|
|
}
|
|
|
|
func (UnimplementedContractServer) mustEmbedUnimplementedContractServer() {}
|
|
|
|
// UnsafeContractServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ContractServer will
|
|
// result in compilation errors.
|
|
type UnsafeContractServer interface {
|
|
mustEmbedUnimplementedContractServer()
|
|
}
|
|
|
|
func RegisterContractServer(s grpc_go.ServiceRegistrar, srv ContractServer) {
|
|
s.RegisterService(&Contract_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Contract_FinishContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(FinishContractRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("FinishContract", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_ContractList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ContractListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("ContractList", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_GetContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetContractRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("GetContract", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_ContractTxList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ContractTxListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("ContractTxList", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_SignContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SignContractRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("SignContract", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_UpdateContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateContractRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("UpdateContract", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Contract_UpdateContractTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateContractTxRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
|
args := []interface{}{}
|
|
args = append(args, in)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
invAttachment := make(map[string]interface{}, len(md))
|
|
for k, v := range md {
|
|
invAttachment[k] = v
|
|
}
|
|
invo := invocation.NewRPCInvocation("UpdateContractTx", args, invAttachment)
|
|
if interceptor == nil {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
info := &grpc_go.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
|
return result, result.Error()
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Contract_ServiceDesc is the grpc_go.ServiceDesc for Contract service.
|
|
// It's only intended for direct use with grpc_go.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Contract_ServiceDesc = grpc_go.ServiceDesc{
|
|
ServiceName: "Contract.Contract",
|
|
HandlerType: (*ContractServer)(nil),
|
|
Methods: []grpc_go.MethodDesc{
|
|
{
|
|
MethodName: "FinishContract",
|
|
Handler: _Contract_FinishContract_Handler,
|
|
},
|
|
{
|
|
MethodName: "ContractList",
|
|
Handler: _Contract_ContractList_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetContract",
|
|
Handler: _Contract_GetContract_Handler,
|
|
},
|
|
{
|
|
MethodName: "ContractTxList",
|
|
Handler: _Contract_ContractTxList_Handler,
|
|
},
|
|
{
|
|
MethodName: "SignContract",
|
|
Handler: _Contract_SignContract_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateContract",
|
|
Handler: _Contract_UpdateContract_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateContractTx",
|
|
Handler: _Contract_UpdateContractTx_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc_go.StreamDesc{},
|
|
Metadata: "api/contract/contract.proto",
|
|
}
|