123 lines
4.7 KiB
Go
123 lines
4.7 KiB
Go
// Code generated by protoc-gen-triple. DO NOT EDIT.
|
|
//
|
|
// Source: castlove_config.proto
|
|
package castlove
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
import (
|
|
"dubbo.apache.org/dubbo-go/v3"
|
|
"dubbo.apache.org/dubbo-go/v3/client"
|
|
"dubbo.apache.org/dubbo-go/v3/common"
|
|
"dubbo.apache.org/dubbo-go/v3/common/constant"
|
|
"dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol"
|
|
"dubbo.apache.org/dubbo-go/v3/server"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file and the Triple package
|
|
// are compatible. If you get a compiler error that this constant is not defined, this code was
|
|
// generated with a version of Triple newer than the one compiled into your binary. You can fix the
|
|
// problem by either regenerating this code with an older version of Triple or updating the Triple
|
|
// version compiled into your binary.
|
|
const _ = triple_protocol.IsAtLeastVersion0_1_0
|
|
|
|
const (
|
|
// CastloveConfigServiceName is the fully-qualified name of the CastloveConfigService service.
|
|
CastloveConfigServiceName = "topfans.castlove.CastloveConfigService"
|
|
)
|
|
|
|
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
|
// exposed at runtime as procedure and as the final two segments of the HTTP route.
|
|
//
|
|
// Note that these are different from the fully-qualified method names used by
|
|
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
|
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
|
// period.
|
|
const (
|
|
// CastloveConfigServiceGetCastloveConfigProcedure is the fully-qualified name of the CastloveConfigService's GetCastloveConfig RPC.
|
|
CastloveConfigServiceGetCastloveConfigProcedure = "/topfans.castlove.CastloveConfigService/GetCastloveConfig"
|
|
)
|
|
|
|
var (
|
|
_ CastloveConfigService = (*CastloveConfigServiceImpl)(nil)
|
|
)
|
|
|
|
// CastloveConfigService is a client for the topfans.castlove.CastloveConfigService service.
|
|
type CastloveConfigService interface {
|
|
GetCastloveConfig(ctx context.Context, req *GetCastloveConfigRequest, opts ...client.CallOption) (*GetCastloveConfigResponse, error)
|
|
}
|
|
|
|
// NewCastloveConfigService constructs a client for the castlove.CastloveConfigService service.
|
|
func NewCastloveConfigService(cli *client.Client, opts ...client.ReferenceOption) (CastloveConfigService, error) {
|
|
conn, err := cli.DialWithInfo("topfans.castlove.CastloveConfigService", &CastloveConfigService_ClientInfo, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &CastloveConfigServiceImpl{
|
|
conn: conn,
|
|
}, nil
|
|
}
|
|
|
|
func SetConsumerCastloveConfigService(srv common.RPCService) {
|
|
dubbo.SetConsumerServiceWithInfo(srv, &CastloveConfigService_ClientInfo)
|
|
}
|
|
|
|
// CastloveConfigServiceImpl implements CastloveConfigService.
|
|
type CastloveConfigServiceImpl struct {
|
|
conn *client.Connection
|
|
}
|
|
|
|
func (c *CastloveConfigServiceImpl) GetCastloveConfig(ctx context.Context, req *GetCastloveConfigRequest, opts ...client.CallOption) (*GetCastloveConfigResponse, error) {
|
|
resp := new(GetCastloveConfigResponse)
|
|
if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetCastloveConfig", opts...); err != nil {
|
|
return nil, err
|
|
}
|
|
return resp, nil
|
|
}
|
|
|
|
var CastloveConfigService_ClientInfo = client.ClientInfo{
|
|
InterfaceName: "topfans.castlove.CastloveConfigService",
|
|
MethodNames: []string{"GetCastloveConfig"},
|
|
ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
|
|
dubboCli := dubboCliRaw.(*CastloveConfigServiceImpl)
|
|
dubboCli.conn = conn
|
|
},
|
|
}
|
|
|
|
// CastloveConfigServiceHandler is an implementation of the topfans.castlove.CastloveConfigService service.
|
|
type CastloveConfigServiceHandler interface {
|
|
GetCastloveConfig(context.Context, *GetCastloveConfigRequest) (*GetCastloveConfigResponse, error)
|
|
}
|
|
|
|
func RegisterCastloveConfigServiceHandler(srv *server.Server, hdlr CastloveConfigServiceHandler, opts ...server.ServiceOption) error {
|
|
return srv.Register(hdlr, &CastloveConfigService_ServiceInfo, opts...)
|
|
}
|
|
|
|
func SetProviderCastloveConfigService(srv common.RPCService) {
|
|
dubbo.SetProviderServiceWithInfo(srv, &CastloveConfigService_ServiceInfo)
|
|
}
|
|
|
|
var CastloveConfigService_ServiceInfo = server.ServiceInfo{
|
|
InterfaceName: "topfans.castlove.CastloveConfigService",
|
|
ServiceType: (*CastloveConfigServiceHandler)(nil),
|
|
Methods: []server.MethodInfo{
|
|
{
|
|
Name: "GetCastloveConfig",
|
|
Type: constant.CallUnary,
|
|
ReqInitFunc: func() interface{} {
|
|
return new(GetCastloveConfigRequest)
|
|
},
|
|
MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
|
|
req := args[0].(*GetCastloveConfigRequest)
|
|
res, err := handler.(CastloveConfigServiceHandler).GetCastloveConfig(ctx, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return triple_protocol.NewResponse(res), nil
|
|
},
|
|
},
|
|
},
|
|
}
|