api

package
v0.0.0-...-64808f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Code generated by protoc-gen-triple. DO NOT EDIT.

Source: user_api.proto

Index

Constants

View Source
const (
	// UserServiceRegisterProcedure is the fully-qualified name of the UserService's Register RPC.
	UserServiceRegisterProcedure = "/org.apache.dubbogo.samples.shop.user.api.UserService/Register"
	// UserServiceLoginProcedure is the fully-qualified name of the UserService's Login RPC.
	UserServiceLoginProcedure = "/org.apache.dubbogo.samples.shop.user.api.UserService/Login"
	// UserServiceTimeoutLoginProcedure is the fully-qualified name of the UserService's TimeoutLogin RPC.
	UserServiceTimeoutLoginProcedure = "/org.apache.dubbogo.samples.shop.user.api.UserService/TimeoutLogin"
	// UserServiceGetInfoProcedure is the fully-qualified name of the UserService's GetInfo RPC.
	UserServiceGetInfoProcedure = "/org.apache.dubbogo.samples.shop.user.api.UserService/GetInfo"
)

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.

View Source
const (
	// UserServiceName is the fully-qualified name of the UserService service.
	UserServiceName = "org.apache.dubbogo.samples.shop.user.api.UserService"
)

Variables

View Source
var File_user_api_proto protoreflect.FileDescriptor
View Source
var UserService_ClientInfo = client.ClientInfo{
	InterfaceName: "org.apache.dubbogo.samples.shop.user.api.UserService",
	MethodNames:   []string{"Register", "Login", "TimeoutLogin", "GetInfo"},
	ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) {
		dubboCli := dubboCliRaw.(*UserServiceImpl)
		dubboCli.conn = conn
	},
}
View Source
var UserService_ServiceInfo = server.ServiceInfo{
	InterfaceName: "org.apache.dubbogo.samples.shop.user.api.UserService",
	ServiceType:   (*UserServiceHandler)(nil),
	Methods: []server.MethodInfo{
		{
			Name: "Register",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(User)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*User)
				res, err := handler.(UserServiceHandler).Register(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
		{
			Name: "Login",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(LoginReq)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*LoginReq)
				res, err := handler.(UserServiceHandler).Login(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
		{
			Name: "TimeoutLogin",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(LoginReq)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*LoginReq)
				res, err := handler.(UserServiceHandler).TimeoutLogin(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
		{
			Name: "GetInfo",
			Type: constant.CallUnary,
			ReqInitFunc: func() interface{} {
				return new(GetInfoReq)
			},
			MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) {
				req := args[0].(*GetInfoReq)
				res, err := handler.(UserServiceHandler).GetInfo(ctx, req)
				if err != nil {
					return nil, err
				}
				return triple_protocol.NewResponse(res), nil
			},
		},
	},
}

Functions

func RegisterUserServiceHandler

func RegisterUserServiceHandler(srv *server.Server, hdlr UserServiceHandler, opts ...server.ServiceOption) error

func SetConsumerService

func SetConsumerService(srv common.RPCService)

func SetProviderService

func SetProviderService(srv common.RPCService)

Types

type GetInfoReq

type GetInfoReq struct {
	Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"`
	// contains filtered or unexported fields
}

func (*GetInfoReq) Descriptor deprecated

func (*GetInfoReq) Descriptor() ([]byte, []int)

Deprecated: Use GetInfoReq.ProtoReflect.Descriptor instead.

func (*GetInfoReq) GetUsername

func (x *GetInfoReq) GetUsername() string

func (*GetInfoReq) ProtoMessage

func (*GetInfoReq) ProtoMessage()

func (*GetInfoReq) ProtoReflect

func (x *GetInfoReq) ProtoReflect() protoreflect.Message

func (*GetInfoReq) Reset

func (x *GetInfoReq) Reset()

func (*GetInfoReq) String

func (x *GetInfoReq) String() string

type LoginReq

type LoginReq struct {
	Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=Password,proto3" json:"Password,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginReq) Descriptor deprecated

func (*LoginReq) Descriptor() ([]byte, []int)

Deprecated: Use LoginReq.ProtoReflect.Descriptor instead.

func (*LoginReq) GetPassword

func (x *LoginReq) GetPassword() string

func (*LoginReq) GetUsername

func (x *LoginReq) GetUsername() string

func (*LoginReq) ProtoMessage

func (*LoginReq) ProtoMessage()

func (*LoginReq) ProtoReflect

func (x *LoginReq) ProtoReflect() protoreflect.Message

func (*LoginReq) Reset

func (x *LoginReq) Reset()

func (*LoginReq) String

func (x *LoginReq) String() string

type RegisterResp

type RegisterResp struct {
	Success bool `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterResp) Descriptor deprecated

func (*RegisterResp) Descriptor() ([]byte, []int)

Deprecated: Use RegisterResp.ProtoReflect.Descriptor instead.

func (*RegisterResp) GetSuccess

func (x *RegisterResp) GetSuccess() bool

func (*RegisterResp) ProtoMessage

func (*RegisterResp) ProtoMessage()

func (*RegisterResp) ProtoReflect

func (x *RegisterResp) ProtoReflect() protoreflect.Message

func (*RegisterResp) Reset

func (x *RegisterResp) Reset()

func (*RegisterResp) String

func (x *RegisterResp) String() string

type User

type User struct {
	Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"Username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=Password,proto3" json:"Password,omitempty"`
	RealName string `protobuf:"bytes,3,opt,name=RealName,proto3" json:"RealName,omitempty"`
	Mail     string `protobuf:"bytes,4,opt,name=Mail,proto3" json:"Mail,omitempty"`
	Phone    string `protobuf:"bytes,5,opt,name=Phone,proto3" json:"Phone,omitempty"`
	Env      string `protobuf:"bytes,6,opt,name=Env,proto3" json:"Env,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEnv

func (x *User) GetEnv() string

func (*User) GetMail

func (x *User) GetMail() string

func (*User) GetPassword

func (x *User) GetPassword() string

func (*User) GetPhone

func (x *User) GetPhone() string

func (*User) GetRealName

func (x *User) GetRealName() string

func (*User) GetUsername

func (x *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

type UserService

type UserService interface {
	Register(ctx context.Context, req *User, opts ...client.CallOption) (*RegisterResp, error)
	Login(ctx context.Context, req *LoginReq, opts ...client.CallOption) (*User, error)
	TimeoutLogin(ctx context.Context, req *LoginReq, opts ...client.CallOption) (*User, error)
	GetInfo(ctx context.Context, req *GetInfoReq, opts ...client.CallOption) (*User, error)
}

UserService is a client for the org.apache.dubbogo.samples.shop.user.api.UserService service.

func NewUserService

func NewUserService(cli *client.Client, opts ...client.ReferenceOption) (UserService, error)

NewUserService constructs a client for the api.UserService service.

type UserServiceHandler

type UserServiceHandler interface {
	Register(context.Context, *User) (*RegisterResp, error)
	Login(context.Context, *LoginReq) (*User, error)
	TimeoutLogin(context.Context, *LoginReq) (*User, error)
	GetInfo(context.Context, *GetInfoReq) (*User, error)
}

UserServiceHandler is an implementation of the org.apache.dubbogo.samples.shop.user.api.UserService service.

type UserServiceImpl

type UserServiceImpl struct {
	// contains filtered or unexported fields
}

UserServiceImpl implements UserService.

func (*UserServiceImpl) GetInfo

func (c *UserServiceImpl) GetInfo(ctx context.Context, req *GetInfoReq, opts ...client.CallOption) (*User, error)

func (*UserServiceImpl) Login

func (c *UserServiceImpl) Login(ctx context.Context, req *LoginReq, opts ...client.CallOption) (*User, error)

func (*UserServiceImpl) Register

func (c *UserServiceImpl) Register(ctx context.Context, req *User, opts ...client.CallOption) (*RegisterResp, error)

func (*UserServiceImpl) TimeoutLogin

func (c *UserServiceImpl) TimeoutLogin(ctx context.Context, req *LoginReq, opts ...client.CallOption) (*User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL