user

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_user_proto protoreflect.FileDescriptor

Functions

func NewDemoServiceEndpoints

func NewDemoServiceEndpoints() []*api.Endpoint

func RegisterDemoServiceHandler

func RegisterDemoServiceHandler(s server.Server, hdlr DemoServiceHandler, opts ...server.HandlerOption) error

Types

type DemoRequest

type DemoRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` /// 用户名
	// contains filtered or unexported fields
}

* 示例请求对象1

func (*DemoRequest) Descriptor deprecated

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

Deprecated: Use DemoRequest.ProtoReflect.Descriptor instead.

func (*DemoRequest) GetName

func (x *DemoRequest) GetName() string

func (*DemoRequest) ProtoMessage

func (*DemoRequest) ProtoMessage()

func (*DemoRequest) ProtoReflect

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

func (*DemoRequest) Reset

func (x *DemoRequest) Reset()

func (*DemoRequest) String

func (x *DemoRequest) String() string

type DemoResponse

type DemoResponse struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` /// 问候文本
	// contains filtered or unexported fields
}

* 示例响应对象

func (*DemoResponse) Descriptor deprecated

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

Deprecated: Use DemoResponse.ProtoReflect.Descriptor instead.

func (*DemoResponse) GetText

func (x *DemoResponse) GetText() string

func (*DemoResponse) ProtoMessage

func (*DemoResponse) ProtoMessage()

func (*DemoResponse) ProtoReflect

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

func (*DemoResponse) Reset

func (x *DemoResponse) Reset()

func (*DemoResponse) String

func (x *DemoResponse) String() string

type DemoService

type DemoService interface {
	/// 问候服务接口1,通过客户端传入用户名返回对应的问候文本
	SayHello(ctx context.Context, in *DemoRequest, opts ...client.CallOption) (*DemoResponse, error)
	/// 问候服务接口2,根据客户端传入用户ID返回对应的问候文本
	SayHelloByUserId(ctx context.Context, in *UserRequest, opts ...client.CallOption) (*DemoResponse, error)
}

func NewDemoService

func NewDemoService(name string, c client.Client) DemoService

type DemoServiceHandler

type DemoServiceHandler interface {
	/// 问候服务接口1,通过客户端传入用户名返回对应的问候文本
	SayHello(context.Context, *DemoRequest, *DemoResponse) error
	/// 问候服务接口2,根据客户端传入用户ID返回对应的问候文本
	SayHelloByUserId(context.Context, *UserRequest, *DemoResponse) error
}

type UserRequest

type UserRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` /// 用户 ID
	// contains filtered or unexported fields
}

* 示例请求对象2

func (*UserRequest) Descriptor deprecated

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

Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.

func (*UserRequest) GetId

func (x *UserRequest) GetId() string

func (*UserRequest) ProtoMessage

func (*UserRequest) ProtoMessage()

func (*UserRequest) ProtoReflect

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

func (*UserRequest) Reset

func (x *UserRequest) Reset()

func (*UserRequest) String

func (x *UserRequest) String() string

Jump to

Keyboard shortcuts

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