v1

package
v0.0.0-...-385473e Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Blog_ListUser_FullMethodName = "/v1.Blog/ListUser"
)

Variables

View Source
var Blog_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Blog",
	HandlerType: (*BlogServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListUser",
			Handler:    _Blog_ListUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "blog/v1/blog.proto",
}

Blog_ServiceDesc is the grpc.ServiceDesc for Blog service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_blog_v1_blog_proto protoreflect.FileDescriptor

Functions

func RegisterBlogServer

func RegisterBlogServer(s grpc.ServiceRegistrar, srv BlogServer)

Types

type BlogClient

type BlogClient interface {
	ListUser(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error)
}

BlogClient is the client API for Blog 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.

func NewBlogClient

func NewBlogClient(cc grpc.ClientConnInterface) BlogClient

type BlogServer

type BlogServer interface {
	ListUser(context.Context, *ListUserRequest) (*ListUserResponse, error)
	// contains filtered or unexported methods
}

BlogServer is the server API for Blog service. All implementations must embed UnimplementedBlogServer for forward compatibility

type ListUserRequest

type ListUserRequest struct {
	Limit  int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
	Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

ListUserRequest 指定了 `ListUser` 接口的请求参数.

func (*ListUserRequest) Descriptor deprecated

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

Deprecated: Use ListUserRequest.ProtoReflect.Descriptor instead.

func (*ListUserRequest) GetLimit

func (x *ListUserRequest) GetLimit() int64

func (*ListUserRequest) GetOffset

func (x *ListUserRequest) GetOffset() int64

func (*ListUserRequest) ProtoMessage

func (*ListUserRequest) ProtoMessage()

func (*ListUserRequest) ProtoReflect

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

func (*ListUserRequest) Reset

func (x *ListUserRequest) Reset()

func (*ListUserRequest) String

func (x *ListUserRequest) String() string

type ListUserResponse

type ListUserResponse struct {
	TotalCount int64       `protobuf:"varint,1,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
	Users      []*UserInfo `protobuf:"bytes,2,rep,name=Users,proto3" json:"Users,omitempty"`
	// contains filtered or unexported fields
}

ListUserResponse 指定了 `GET /v1/users` 接口的返回参数,相当于 HTTP Response.

func (*ListUserResponse) Descriptor deprecated

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

Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead.

func (*ListUserResponse) GetTotalCount

func (x *ListUserResponse) GetTotalCount() int64

func (*ListUserResponse) GetUsers

func (x *ListUserResponse) GetUsers() []*UserInfo

func (*ListUserResponse) ProtoMessage

func (*ListUserResponse) ProtoMessage()

func (*ListUserResponse) ProtoReflect

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

func (*ListUserResponse) Reset

func (x *ListUserResponse) Reset()

func (*ListUserResponse) String

func (x *ListUserResponse) String() string

type UnimplementedBlogServer

type UnimplementedBlogServer struct {
}

UnimplementedBlogServer must be embedded to have forward compatible implementations.

func (UnimplementedBlogServer) ListUser

type UnsafeBlogServer

type UnsafeBlogServer interface {
	// contains filtered or unexported methods
}

UnsafeBlogServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlogServer will result in compilation errors.

type UserInfo

type UserInfo struct {
	Username  string                 `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Nickname  string                 `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"`
	Email     string                 `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"`
	Phone     string                 `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
	PostCount int64                  `protobuf:"varint,6,opt,name=postCount,proto3" json:"postCount,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
	// contains filtered or unexported fields
}

func (*UserInfo) Descriptor deprecated

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

Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.

func (*UserInfo) GetCreatedAt

func (x *UserInfo) GetCreatedAt() *timestamppb.Timestamp

func (*UserInfo) GetEmail

func (x *UserInfo) GetEmail() string

func (*UserInfo) GetNickname

func (x *UserInfo) GetNickname() string

func (*UserInfo) GetPhone

func (x *UserInfo) GetPhone() string

func (*UserInfo) GetPostCount

func (x *UserInfo) GetPostCount() int64

func (*UserInfo) GetUpdatedAt

func (x *UserInfo) GetUpdatedAt() *timestamppb.Timestamp

func (*UserInfo) GetUsername

func (x *UserInfo) GetUsername() string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) ProtoReflect

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

func (*UserInfo) Reset

func (x *UserInfo) Reset()

func (*UserInfo) String

func (x *UserInfo) String() string

Jump to

Keyboard shortcuts

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