Documentation
¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterMiniBlogHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMiniBlogHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MiniBlogClient) error
- func RegisterMiniBlogHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMiniBlogHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MiniBlogServer) error
- func RegisterMiniBlogServer(s grpc.ServiceRegistrar, srv MiniBlogServer)
- type ChangePasswordRequest
- func (x *ChangePasswordRequest) Default()
- func (*ChangePasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ChangePasswordRequest) GetNewPassword() string
- func (x *ChangePasswordRequest) GetOldPassword() string
- func (x *ChangePasswordRequest) GetUserID() string
- func (*ChangePasswordRequest) ProtoMessage()
- func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message
- func (x *ChangePasswordRequest) Reset()
- func (x *ChangePasswordRequest) String() string
- type ChangePasswordResponse
- func (x *ChangePasswordResponse) Default()
- func (*ChangePasswordResponse) Descriptor() ([]byte, []int)deprecated
- func (*ChangePasswordResponse) ProtoMessage()
- func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message
- func (x *ChangePasswordResponse) Reset()
- func (x *ChangePasswordResponse) String() string
- type CreatePostRequest
- func (x *CreatePostRequest) Default()
- func (*CreatePostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePostRequest) GetContent() string
- func (x *CreatePostRequest) GetTitle() string
- func (*CreatePostRequest) ProtoMessage()
- func (x *CreatePostRequest) ProtoReflect() protoreflect.Message
- func (x *CreatePostRequest) Reset()
- func (x *CreatePostRequest) String() string
- type CreatePostResponse
- func (x *CreatePostResponse) Default()
- func (*CreatePostResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreatePostResponse) GetPostID() string
- func (*CreatePostResponse) ProtoMessage()
- func (x *CreatePostResponse) ProtoReflect() protoreflect.Message
- func (x *CreatePostResponse) Reset()
- func (x *CreatePostResponse) String() string
- type CreateUserRequest
- func (x *CreateUserRequest) Default()
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetNickname() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetPhone() string
- func (x *CreateUserRequest) GetUsername() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type CreateUserResponse
- func (x *CreateUserResponse) Default()
- func (*CreateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserResponse) GetUserID() string
- func (*CreateUserResponse) ProtoMessage()
- func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
- func (x *CreateUserResponse) Reset()
- func (x *CreateUserResponse) String() string
- type DeletePostRequest
- func (x *DeletePostRequest) Default()
- func (*DeletePostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeletePostRequest) GetPostIDs() []string
- func (*DeletePostRequest) ProtoMessage()
- func (x *DeletePostRequest) ProtoReflect() protoreflect.Message
- func (x *DeletePostRequest) Reset()
- func (x *DeletePostRequest) String() string
- type DeletePostResponse
- type DeleteUserRequest
- func (x *DeleteUserRequest) Default()
- func (*DeleteUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteUserRequest) GetUserID() string
- func (*DeleteUserRequest) ProtoMessage()
- func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteUserRequest) Reset()
- func (x *DeleteUserRequest) String() string
- type DeleteUserResponse
- type GetPostRequest
- func (x *GetPostRequest) Default()
- func (*GetPostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPostRequest) GetPostID() string
- func (*GetPostRequest) ProtoMessage()
- func (x *GetPostRequest) ProtoReflect() protoreflect.Message
- func (x *GetPostRequest) Reset()
- func (x *GetPostRequest) String() string
- type GetPostResponse
- func (x *GetPostResponse) Default()
- func (*GetPostResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPostResponse) GetPost() *Post
- func (*GetPostResponse) ProtoMessage()
- func (x *GetPostResponse) ProtoReflect() protoreflect.Message
- func (x *GetPostResponse) Reset()
- func (x *GetPostResponse) String() string
- type GetUserRequest
- func (x *GetUserRequest) Default()
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetUserID() string
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- type GetUserResponse
- func (x *GetUserResponse) Default()
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetUser() *User
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- type HealthzResponse
- func (x *HealthzResponse) Default()
- func (*HealthzResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HealthzResponse) GetMessage() string
- func (x *HealthzResponse) GetStatus() ServiceStatus
- func (x *HealthzResponse) GetTimestamp() string
- func (*HealthzResponse) ProtoMessage()
- func (x *HealthzResponse) ProtoReflect() protoreflect.Message
- func (x *HealthzResponse) Reset()
- func (x *HealthzResponse) String() string
- type ListPostRequest
- func (x *ListPostRequest) Default()
- func (*ListPostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListPostRequest) GetLimit() int64
- func (x *ListPostRequest) GetOffset() int64
- func (x *ListPostRequest) GetTitle() string
- func (*ListPostRequest) ProtoMessage()
- func (x *ListPostRequest) ProtoReflect() protoreflect.Message
- func (x *ListPostRequest) Reset()
- func (x *ListPostRequest) String() string
- type ListPostResponse
- func (x *ListPostResponse) Default()
- func (*ListPostResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListPostResponse) GetPosts() []*Post
- func (x *ListPostResponse) GetTotal() int64
- func (*ListPostResponse) ProtoMessage()
- func (x *ListPostResponse) ProtoReflect() protoreflect.Message
- func (x *ListPostResponse) Reset()
- func (x *ListPostResponse) String() string
- type ListUserRequest
- func (x *ListUserRequest) Default()
- func (*ListUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListUserRequest) GetLimit() int64
- func (x *ListUserRequest) GetOffset() int64
- func (*ListUserRequest) ProtoMessage()
- func (x *ListUserRequest) ProtoReflect() protoreflect.Message
- func (x *ListUserRequest) Reset()
- func (x *ListUserRequest) String() string
- type ListUserResponse
- func (x *ListUserResponse) Default()
- func (*ListUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListUserResponse) GetTotal() int64
- func (x *ListUserResponse) GetUsers() []*User
- func (*ListUserResponse) ProtoMessage()
- func (x *ListUserResponse) ProtoReflect() protoreflect.Message
- func (x *ListUserResponse) Reset()
- func (x *ListUserResponse) String() string
- type LoginRequest
- func (x *LoginRequest) Default()
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LoginResponse
- func (x *LoginResponse) Default()
- func (*LoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginResponse) GetExpireAt() *timestamppb.Timestamp
- func (x *LoginResponse) GetToken() string
- func (*LoginResponse) ProtoMessage()
- func (x *LoginResponse) ProtoReflect() protoreflect.Message
- func (x *LoginResponse) Reset()
- func (x *LoginResponse) String() string
- type MiniBlogClient
- type MiniBlogServer
- type ModifierExample
- func (x *ModifierExample) Default()
- func (*ModifierExample) Descriptor() ([]byte, []int)deprecated
- func (x *ModifierExample) GetAddress() map[string]int64
- func (x *ModifierExample) GetContent() []byte
- func (x *ModifierExample) GetCount() int64
- func (x *ModifierExample) GetCreateAt() *timestamppb.Timestamp
- func (x *ModifierExample) GetHasEmail() bool
- func (x *ModifierExample) GetMoney() int32
- func (x *ModifierExample) GetNickname() string
- func (x *ModifierExample) GetPhones() []string
- func (x *ModifierExample) GetStatus() UserStatus
- func (x *ModifierExample) GetUsername() string
- func (*ModifierExample) ProtoMessage()
- func (x *ModifierExample) ProtoReflect() protoreflect.Message
- func (x *ModifierExample) Reset()
- func (x *ModifierExample) String() string
- type Post
- func (x *Post) Default()
- func (*Post) Descriptor() ([]byte, []int)deprecated
- func (x *Post) GetContent() string
- func (x *Post) GetCreatedAt() *timestamppb.Timestamp
- func (x *Post) GetPostID() string
- func (x *Post) GetTitle() string
- func (x *Post) GetUpdatedAt() *timestamppb.Timestamp
- func (x *Post) GetUserID() string
- func (*Post) ProtoMessage()
- func (x *Post) ProtoReflect() protoreflect.Message
- func (x *Post) Reset()
- func (x *Post) String() string
- type RefreshTokenRequest
- type RefreshTokenResponse
- func (x *RefreshTokenResponse) Default()
- func (*RefreshTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshTokenResponse) GetExpireAt() *timestamppb.Timestamp
- func (x *RefreshTokenResponse) GetToken() string
- func (*RefreshTokenResponse) ProtoMessage()
- func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message
- func (x *RefreshTokenResponse) Reset()
- func (x *RefreshTokenResponse) String() string
- type ServiceStatus
- func (ServiceStatus) Descriptor() protoreflect.EnumDescriptor
- func (x ServiceStatus) Enum() *ServiceStatus
- func (ServiceStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x ServiceStatus) Number() protoreflect.EnumNumber
- func (x ServiceStatus) String() string
- func (ServiceStatus) Type() protoreflect.EnumType
- type UnimplementedMiniBlogServer
- func (UnimplementedMiniBlogServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
- func (UnimplementedMiniBlogServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
- func (UnimplementedMiniBlogServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
- func (UnimplementedMiniBlogServer) DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error)
- func (UnimplementedMiniBlogServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
- func (UnimplementedMiniBlogServer) GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
- func (UnimplementedMiniBlogServer) GetPostList(context.Context, *ListPostRequest) (*ListPostResponse, error)
- func (UnimplementedMiniBlogServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
- func (UnimplementedMiniBlogServer) GetUserList(context.Context, *ListUserRequest) (*ListUserResponse, error)
- func (UnimplementedMiniBlogServer) Healthz(context.Context, *emptypb.Empty) (*HealthzResponse, error)
- func (UnimplementedMiniBlogServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (UnimplementedMiniBlogServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
- func (UnimplementedMiniBlogServer) UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error)
- func (UnimplementedMiniBlogServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
- type UnsafeMiniBlogServer
- type UpdatePostRequest
- func (x *UpdatePostRequest) Default()
- func (*UpdatePostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePostRequest) GetContent() string
- func (x *UpdatePostRequest) GetPostID() string
- func (x *UpdatePostRequest) GetTitle() string
- func (*UpdatePostRequest) ProtoMessage()
- func (x *UpdatePostRequest) ProtoReflect() protoreflect.Message
- func (x *UpdatePostRequest) Reset()
- func (x *UpdatePostRequest) String() string
- type UpdatePostResponse
- type UpdateUserRequest
- func (x *UpdateUserRequest) Default()
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetEmail() string
- func (x *UpdateUserRequest) GetNickname() string
- func (x *UpdateUserRequest) GetPhone() string
- func (x *UpdateUserRequest) GetUserID() string
- func (x *UpdateUserRequest) GetUsername() string
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type UpdateUserResponse
- type User
- func (x *User) Default()
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamppb.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetNickname() string
- func (x *User) GetPhone() string
- func (x *User) GetPostCount() int64
- func (x *User) GetUpdatedAt() *timestamppb.Timestamp
- func (x *User) GetUserID() string
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserStatus
Constants ¶
const ( MiniBlog_Healthz_FullMethodName = "/v1.MiniBlog/Healthz" MiniBlog_Login_FullMethodName = "/v1.MiniBlog/Login" MiniBlog_RefreshToken_FullMethodName = "/v1.MiniBlog/RefreshToken" MiniBlog_ChangePassword_FullMethodName = "/v1.MiniBlog/ChangePassword" MiniBlog_CreateUser_FullMethodName = "/v1.MiniBlog/CreateUser" MiniBlog_UpdateUser_FullMethodName = "/v1.MiniBlog/UpdateUser" MiniBlog_DeleteUser_FullMethodName = "/v1.MiniBlog/DeleteUser" MiniBlog_GetUser_FullMethodName = "/v1.MiniBlog/GetUser" MiniBlog_GetUserList_FullMethodName = "/v1.MiniBlog/GetUserList" MiniBlog_CreatePost_FullMethodName = "/v1.MiniBlog/CreatePost" MiniBlog_UpdatePost_FullMethodName = "/v1.MiniBlog/UpdatePost" MiniBlog_DeletePost_FullMethodName = "/v1.MiniBlog/DeletePost" MiniBlog_GetPost_FullMethodName = "/v1.MiniBlog/GetPost" MiniBlog_GetPostList_FullMethodName = "/v1.MiniBlog/GetPostList" )
Variables ¶
var ( UserStatus_name = map[int32]string{ 0: "Active", 1: "Inactive", 2: "Banned", } UserStatus_value = map[string]int32{ "Active": 0, "Inactive": 1, "Banned": 2, } )
Enum value maps for UserStatus.
var ( ServiceStatus_name = map[int32]string{ 0: "ServiceStatusHealthy", 1: "ServiceStatusUnhealthy", } ServiceStatus_value = map[string]int32{ "ServiceStatusHealthy": 0, "ServiceStatusUnhealthy": 1, } )
Enum value maps for ServiceStatus.
var File_apiserver_v1_apiserver_proto protoreflect.FileDescriptor
var File_apiserver_v1_example_proto protoreflect.FileDescriptor
var File_apiserver_v1_healthz_proto protoreflect.FileDescriptor
var File_apiserver_v1_post_proto protoreflect.FileDescriptor
var File_apiserver_v1_user_proto protoreflect.FileDescriptor
var MiniBlog_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v1.MiniBlog", HandlerType: (*MiniBlogServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Healthz", Handler: _MiniBlog_Healthz_Handler, }, { MethodName: "Login", Handler: _MiniBlog_Login_Handler, }, { MethodName: "RefreshToken", Handler: _MiniBlog_RefreshToken_Handler, }, { MethodName: "ChangePassword", Handler: _MiniBlog_ChangePassword_Handler, }, { MethodName: "CreateUser", Handler: _MiniBlog_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _MiniBlog_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _MiniBlog_DeleteUser_Handler, }, { MethodName: "GetUser", Handler: _MiniBlog_GetUser_Handler, }, { MethodName: "GetUserList", Handler: _MiniBlog_GetUserList_Handler, }, { MethodName: "CreatePost", Handler: _MiniBlog_CreatePost_Handler, }, { MethodName: "UpdatePost", Handler: _MiniBlog_UpdatePost_Handler, }, { MethodName: "DeletePost", Handler: _MiniBlog_DeletePost_Handler, }, { MethodName: "GetPost", Handler: _MiniBlog_GetPost_Handler, }, { MethodName: "GetPostList", Handler: _MiniBlog_GetPostList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apiserver/v1/apiserver.proto", }
MiniBlog_ServiceDesc is the grpc.ServiceDesc for MiniBlog service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMiniBlogHandler ¶
func RegisterMiniBlogHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterMiniBlogHandler registers the http handlers for service MiniBlog to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMiniBlogHandlerClient ¶
func RegisterMiniBlogHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MiniBlogClient) error
RegisterMiniBlogHandlerClient registers the http handlers for service MiniBlog to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MiniBlogClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MiniBlogClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MiniBlogClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterMiniBlogHandlerFromEndpoint ¶
func RegisterMiniBlogHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMiniBlogHandlerFromEndpoint is same as RegisterMiniBlogHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMiniBlogHandlerServer ¶
func RegisterMiniBlogHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MiniBlogServer) error
RegisterMiniBlogHandlerServer registers the http handlers for service MiniBlog to "mux". UnaryRPC :call MiniBlogServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMiniBlogHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterMiniBlogServer ¶
func RegisterMiniBlogServer(s grpc.ServiceRegistrar, srv MiniBlogServer)
Types ¶
type ChangePasswordRequest ¶
type ChangePasswordRequest struct {
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` // user id
OldPassword string `protobuf:"bytes,2,opt,name=oldPassword,proto3" json:"oldPassword,omitempty"` // user old password
NewPassword string `protobuf:"bytes,3,opt,name=newPassword,proto3" json:"newPassword,omitempty"` // user new password
// contains filtered or unexported fields
}
ChangePasswordRequest is the request of ChangePassword
func (*ChangePasswordRequest) Default ¶
func (x *ChangePasswordRequest) Default()
func (*ChangePasswordRequest) Descriptor
deprecated
func (*ChangePasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead.
func (*ChangePasswordRequest) GetNewPassword ¶
func (x *ChangePasswordRequest) GetNewPassword() string
func (*ChangePasswordRequest) GetOldPassword ¶
func (x *ChangePasswordRequest) GetOldPassword() string
func (*ChangePasswordRequest) GetUserID ¶
func (x *ChangePasswordRequest) GetUserID() string
func (*ChangePasswordRequest) ProtoMessage ¶
func (*ChangePasswordRequest) ProtoMessage()
func (*ChangePasswordRequest) ProtoReflect ¶
func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message
func (*ChangePasswordRequest) Reset ¶
func (x *ChangePasswordRequest) Reset()
func (*ChangePasswordRequest) String ¶
func (x *ChangePasswordRequest) String() string
type ChangePasswordResponse ¶
type ChangePasswordResponse struct {
// contains filtered or unexported fields
}
ChangePasswordResponse is the response of ChangePassword
func (*ChangePasswordResponse) Default ¶
func (x *ChangePasswordResponse) Default()
func (*ChangePasswordResponse) Descriptor
deprecated
func (*ChangePasswordResponse) Descriptor() ([]byte, []int)
Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead.
func (*ChangePasswordResponse) ProtoMessage ¶
func (*ChangePasswordResponse) ProtoMessage()
func (*ChangePasswordResponse) ProtoReflect ¶
func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message
func (*ChangePasswordResponse) Reset ¶
func (x *ChangePasswordResponse) Reset()
func (*ChangePasswordResponse) String ¶
func (x *ChangePasswordResponse) String() string
type CreatePostRequest ¶
type CreatePostRequest struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` // post title
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // post content
// contains filtered or unexported fields
}
CreatePostRequest is the request of CreatePost
func (*CreatePostRequest) Default ¶
func (x *CreatePostRequest) Default()
func (*CreatePostRequest) Descriptor
deprecated
func (*CreatePostRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreatePostRequest.ProtoReflect.Descriptor instead.
func (*CreatePostRequest) GetContent ¶
func (x *CreatePostRequest) GetContent() string
func (*CreatePostRequest) GetTitle ¶
func (x *CreatePostRequest) GetTitle() string
func (*CreatePostRequest) ProtoMessage ¶
func (*CreatePostRequest) ProtoMessage()
func (*CreatePostRequest) ProtoReflect ¶
func (x *CreatePostRequest) ProtoReflect() protoreflect.Message
func (*CreatePostRequest) Reset ¶
func (x *CreatePostRequest) Reset()
func (*CreatePostRequest) String ¶
func (x *CreatePostRequest) String() string
type CreatePostResponse ¶
type CreatePostResponse struct {
PostID string `protobuf:"bytes,1,opt,name=postID,proto3" json:"postID,omitempty"` // post id
// contains filtered or unexported fields
}
CreatePostResponse is the response of CreatePost
func (*CreatePostResponse) Default ¶
func (x *CreatePostResponse) Default()
func (*CreatePostResponse) Descriptor
deprecated
func (*CreatePostResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreatePostResponse.ProtoReflect.Descriptor instead.
func (*CreatePostResponse) GetPostID ¶
func (x *CreatePostResponse) GetPostID() string
func (*CreatePostResponse) ProtoMessage ¶
func (*CreatePostResponse) ProtoMessage()
func (*CreatePostResponse) ProtoReflect ¶
func (x *CreatePostResponse) ProtoReflect() protoreflect.Message
func (*CreatePostResponse) Reset ¶
func (x *CreatePostResponse) Reset()
func (*CreatePostResponse) String ¶
func (x *CreatePostResponse) String() string
type CreateUserRequest ¶
type CreateUserRequest struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // user name
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // user password
Nickname *string `protobuf:"bytes,3,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"` // user nickname
Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // user email
Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` // user phone
// contains filtered or unexported fields
}
CreateUserRequest is the request of CreateUser
func (*CreateUserRequest) Default ¶
func (x *CreateUserRequest) Default()
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetEmail ¶
func (x *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetNickname ¶
func (x *CreateUserRequest) GetNickname() string
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetPhone ¶
func (x *CreateUserRequest) GetPhone() string
func (*CreateUserRequest) GetUsername ¶
func (x *CreateUserRequest) GetUsername() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type CreateUserResponse ¶
type CreateUserResponse struct {
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` // user id
// contains filtered or unexported fields
}
CreateUserResponse is the response of CreateUser
func (*CreateUserResponse) Default ¶
func (x *CreateUserResponse) Default()
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetUserID ¶
func (x *CreateUserResponse) GetUserID() string
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) String() string
type DeletePostRequest ¶
type DeletePostRequest struct {
PostIDs []string `protobuf:"bytes,1,rep,name=postIDs,proto3" json:"postIDs,omitempty"` // post id list
// contains filtered or unexported fields
}
DeletePostRequest is the request of DeletePost
func (*DeletePostRequest) Default ¶
func (x *DeletePostRequest) Default()
func (*DeletePostRequest) Descriptor
deprecated
func (*DeletePostRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeletePostRequest.ProtoReflect.Descriptor instead.
func (*DeletePostRequest) GetPostIDs ¶
func (x *DeletePostRequest) GetPostIDs() []string
func (*DeletePostRequest) ProtoMessage ¶
func (*DeletePostRequest) ProtoMessage()
func (*DeletePostRequest) ProtoReflect ¶
func (x *DeletePostRequest) ProtoReflect() protoreflect.Message
func (*DeletePostRequest) Reset ¶
func (x *DeletePostRequest) Reset()
func (*DeletePostRequest) String ¶
func (x *DeletePostRequest) String() string
type DeletePostResponse ¶
type DeletePostResponse struct {
// contains filtered or unexported fields
}
DeletePostResponse is the response of DeletePost
func (*DeletePostResponse) Default ¶
func (x *DeletePostResponse) Default()
func (*DeletePostResponse) Descriptor
deprecated
func (*DeletePostResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeletePostResponse.ProtoReflect.Descriptor instead.
func (*DeletePostResponse) ProtoMessage ¶
func (*DeletePostResponse) ProtoMessage()
func (*DeletePostResponse) ProtoReflect ¶
func (x *DeletePostResponse) ProtoReflect() protoreflect.Message
func (*DeletePostResponse) Reset ¶
func (x *DeletePostResponse) Reset()
func (*DeletePostResponse) String ¶
func (x *DeletePostResponse) String() string
type DeleteUserRequest ¶
type DeleteUserRequest struct {
// @gotags: uri:"userID"
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty" uri:"userID"` // user id
// contains filtered or unexported fields
}
DeleteUserRequest is the request of DeleteUser
func (*DeleteUserRequest) Default ¶
func (x *DeleteUserRequest) Default()
func (*DeleteUserRequest) Descriptor
deprecated
func (*DeleteUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.
func (*DeleteUserRequest) GetUserID ¶
func (x *DeleteUserRequest) GetUserID() string
func (*DeleteUserRequest) ProtoMessage ¶
func (*DeleteUserRequest) ProtoMessage()
func (*DeleteUserRequest) ProtoReflect ¶
func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message
func (*DeleteUserRequest) Reset ¶
func (x *DeleteUserRequest) Reset()
func (*DeleteUserRequest) String ¶
func (x *DeleteUserRequest) String() string
type DeleteUserResponse ¶
type DeleteUserResponse struct {
// contains filtered or unexported fields
}
DeleteUserResponse is the response of DeleteUser
func (*DeleteUserResponse) Default ¶
func (x *DeleteUserResponse) Default()
func (*DeleteUserResponse) Descriptor
deprecated
func (*DeleteUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead.
func (*DeleteUserResponse) ProtoMessage ¶
func (*DeleteUserResponse) ProtoMessage()
func (*DeleteUserResponse) ProtoReflect ¶
func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message
func (*DeleteUserResponse) Reset ¶
func (x *DeleteUserResponse) Reset()
func (*DeleteUserResponse) String ¶
func (x *DeleteUserResponse) String() string
type GetPostRequest ¶
type GetPostRequest struct {
// @gotags: uri:"postID"
PostID string `protobuf:"bytes,1,opt,name=postID,proto3" json:"postID,omitempty" uri:"postID"` // post id
// contains filtered or unexported fields
}
GetPostRequest is the request of GetPost
func (*GetPostRequest) Default ¶
func (x *GetPostRequest) Default()
func (*GetPostRequest) Descriptor
deprecated
func (*GetPostRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPostRequest.ProtoReflect.Descriptor instead.
func (*GetPostRequest) GetPostID ¶
func (x *GetPostRequest) GetPostID() string
func (*GetPostRequest) ProtoMessage ¶
func (*GetPostRequest) ProtoMessage()
func (*GetPostRequest) ProtoReflect ¶
func (x *GetPostRequest) ProtoReflect() protoreflect.Message
func (*GetPostRequest) Reset ¶
func (x *GetPostRequest) Reset()
func (*GetPostRequest) String ¶
func (x *GetPostRequest) String() string
type GetPostResponse ¶
type GetPostResponse struct {
Post *Post `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` // post
// contains filtered or unexported fields
}
GetPostResponse is the response of GetPost
func (*GetPostResponse) Default ¶
func (x *GetPostResponse) Default()
func (*GetPostResponse) Descriptor
deprecated
func (*GetPostResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPostResponse.ProtoReflect.Descriptor instead.
func (*GetPostResponse) GetPost ¶
func (x *GetPostResponse) GetPost() *Post
func (*GetPostResponse) ProtoMessage ¶
func (*GetPostResponse) ProtoMessage()
func (*GetPostResponse) ProtoReflect ¶
func (x *GetPostResponse) ProtoReflect() protoreflect.Message
func (*GetPostResponse) Reset ¶
func (x *GetPostResponse) Reset()
func (*GetPostResponse) String ¶
func (x *GetPostResponse) String() string
type GetUserRequest ¶
type GetUserRequest struct {
// @gotags: uri:"userID"
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty" uri:"userID"` // user id
// contains filtered or unexported fields
}
GetUserRequest is the request of GetUser
func (*GetUserRequest) Default ¶
func (x *GetUserRequest) Default()
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetUserID ¶
func (x *GetUserRequest) GetUserID() string
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type GetUserResponse ¶
type GetUserResponse struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // user
// contains filtered or unexported fields
}
GetUserResponse is the response of GetUser
func (*GetUserResponse) Default ¶
func (x *GetUserResponse) Default()
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetUser ¶
func (x *GetUserResponse) GetUser() *User
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
type HealthzResponse ¶
type HealthzResponse struct {
// Status is the server health status
Status ServiceStatus `protobuf:"varint,1,opt,name=status,proto3,enum=v1.ServiceStatus" json:"status,omitempty"`
// Timestamp is the server health timestamp
Timestamp string `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// Message is the server health message
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
HealthzResponse is the response of Healthz
func (*HealthzResponse) Default ¶
func (x *HealthzResponse) Default()
func (*HealthzResponse) Descriptor
deprecated
func (*HealthzResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthzResponse.ProtoReflect.Descriptor instead.
func (*HealthzResponse) GetMessage ¶
func (x *HealthzResponse) GetMessage() string
func (*HealthzResponse) GetStatus ¶
func (x *HealthzResponse) GetStatus() ServiceStatus
func (*HealthzResponse) GetTimestamp ¶
func (x *HealthzResponse) GetTimestamp() string
func (*HealthzResponse) ProtoMessage ¶
func (*HealthzResponse) ProtoMessage()
func (*HealthzResponse) ProtoReflect ¶
func (x *HealthzResponse) ProtoReflect() protoreflect.Message
func (*HealthzResponse) Reset ¶
func (x *HealthzResponse) Reset()
func (*HealthzResponse) String ¶
func (x *HealthzResponse) String() string
type ListPostRequest ¶
type ListPostRequest struct {
// @gotags: uri:"offset"
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty" uri:"offset"` // offset
// @gotags: uri:"limit"
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty" uri:"limit"` // limit
Title *string `protobuf:"bytes,3,opt,name=title,proto3,oneof" json:"title,omitempty"` // post title
// contains filtered or unexported fields
}
ListPostRequest is the request of ListPost
func (*ListPostRequest) Default ¶
func (x *ListPostRequest) Default()
func (*ListPostRequest) Descriptor
deprecated
func (*ListPostRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListPostRequest.ProtoReflect.Descriptor instead.
func (*ListPostRequest) GetLimit ¶
func (x *ListPostRequest) GetLimit() int64
func (*ListPostRequest) GetOffset ¶
func (x *ListPostRequest) GetOffset() int64
func (*ListPostRequest) GetTitle ¶
func (x *ListPostRequest) GetTitle() string
func (*ListPostRequest) ProtoMessage ¶
func (*ListPostRequest) ProtoMessage()
func (*ListPostRequest) ProtoReflect ¶
func (x *ListPostRequest) ProtoReflect() protoreflect.Message
func (*ListPostRequest) Reset ¶
func (x *ListPostRequest) Reset()
func (*ListPostRequest) String ¶
func (x *ListPostRequest) String() string
type ListPostResponse ¶
type ListPostResponse struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` // total count
Posts []*Post `protobuf:"bytes,2,rep,name=posts,proto3" json:"posts,omitempty"` // post list
// contains filtered or unexported fields
}
ListPostResponse is the response of ListPost
func (*ListPostResponse) Default ¶
func (x *ListPostResponse) Default()
func (*ListPostResponse) Descriptor
deprecated
func (*ListPostResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListPostResponse.ProtoReflect.Descriptor instead.
func (*ListPostResponse) GetPosts ¶
func (x *ListPostResponse) GetPosts() []*Post
func (*ListPostResponse) GetTotal ¶
func (x *ListPostResponse) GetTotal() int64
func (*ListPostResponse) ProtoMessage ¶
func (*ListPostResponse) ProtoMessage()
func (*ListPostResponse) ProtoReflect ¶
func (x *ListPostResponse) ProtoReflect() protoreflect.Message
func (*ListPostResponse) Reset ¶
func (x *ListPostResponse) Reset()
func (*ListPostResponse) String ¶
func (x *ListPostResponse) String() string
type ListUserRequest ¶
type ListUserRequest struct {
// @gotags: uri:"offset"
Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty" uri:"offset"` // offset
// @gotags: uri:"limit"
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty" uri:"limit"` // limit
// contains filtered or unexported fields
}
ListUserRequest is the request of ListUser
func (*ListUserRequest) Default ¶
func (x *ListUserRequest) Default()
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 {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` // total user count
Users []*User `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"` // user list
// contains filtered or unexported fields
}
ListUserResponse is the response of ListUser
func (*ListUserResponse) Default ¶
func (x *ListUserResponse) Default()
func (*ListUserResponse) Descriptor
deprecated
func (*ListUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead.
func (*ListUserResponse) GetTotal ¶
func (x *ListUserResponse) GetTotal() int64
func (*ListUserResponse) GetUsers ¶
func (x *ListUserResponse) GetUsers() []*User
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 LoginRequest ¶
type LoginRequest struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // user name
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // user password
// contains filtered or unexported fields
}
LoginRequest is the request of Login
func (*LoginRequest) Default ¶
func (x *LoginRequest) Default()
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // user token
ExpireAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expireAt,proto3" json:"expireAt,omitempty"` // token expire time
// contains filtered or unexported fields
}
LoginResponse is the response of Login
func (*LoginResponse) Default ¶
func (x *LoginResponse) Default()
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetExpireAt ¶
func (x *LoginResponse) GetExpireAt() *timestamppb.Timestamp
func (*LoginResponse) GetToken ¶
func (x *LoginResponse) GetToken() string
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type MiniBlogClient ¶
type MiniBlogClient interface {
// Healthz check
Healthz(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*HealthzResponse, error)
// Login 用户登录
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
// RefreshToken 刷新令牌
RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error)
// ChangePassword 修改密码
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error)
// CreateUser 创建用户
CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error)
// UpdateUser 更新用户信息
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
// DeleteUser 删除用户
DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
// GetUser 获取用户信息
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error)
// GetUserList 列出所有用户
GetUserList(ctx context.Context, in *ListUserRequest, opts ...grpc.CallOption) (*ListUserResponse, error)
// CreatePost 创建文章
CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error)
// UpdatePost 更新文章
UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*UpdatePostResponse, error)
// DeletePost 删除文章
DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*DeletePostResponse, error)
// GetPost 获取文章信息
GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*GetPostResponse, error)
// GetPostList 列出所有文章
GetPostList(ctx context.Context, in *ListPostRequest, opts ...grpc.CallOption) (*ListPostResponse, error)
}
MiniBlogClient is the client API for MiniBlog 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.
MiniBlog rpc server
func NewMiniBlogClient ¶
func NewMiniBlogClient(cc grpc.ClientConnInterface) MiniBlogClient
type MiniBlogServer ¶
type MiniBlogServer interface {
// Healthz check
Healthz(context.Context, *emptypb.Empty) (*HealthzResponse, error)
// Login 用户登录
Login(context.Context, *LoginRequest) (*LoginResponse, error)
// RefreshToken 刷新令牌
RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
// ChangePassword 修改密码
ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
// CreateUser 创建用户
CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
// UpdateUser 更新用户信息
UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
// DeleteUser 删除用户
DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
// GetUser 获取用户信息
GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
// GetUserList 列出所有用户
GetUserList(context.Context, *ListUserRequest) (*ListUserResponse, error)
// CreatePost 创建文章
CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
// UpdatePost 更新文章
UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error)
// DeletePost 删除文章
DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error)
// GetPost 获取文章信息
GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
// GetPostList 列出所有文章
GetPostList(context.Context, *ListPostRequest) (*ListPostResponse, error)
// contains filtered or unexported methods
}
MiniBlogServer is the server API for MiniBlog service. All implementations must embed UnimplementedMiniBlogServer for forward compatibility.
MiniBlog rpc server
type ModifierExample ¶
type ModifierExample struct {
// username is the name of the user
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
// nickname is the nickname of the user
Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"`
// has_email is the email of the user
HasEmail bool `protobuf:"varint,4,opt,name=has_email,json=hasEmail,proto3" json:"has_email,omitempty"`
// phones is the phone number of the user
Phones []string `protobuf:"bytes,5,rep,name=phones,proto3" json:"phones,omitempty"`
// content is the content of the user
Content []byte `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"`
// money is the money of the user
Money int32 `protobuf:"varint,7,opt,name=money,proto3" json:"money,omitempty"`
// count is the count of the user
Count int64 `protobuf:"varint,8,opt,name=count,proto3" json:"count,omitempty"`
// address is the address of the user
Address map[string]int64 `` /* 142-byte string literal not displayed */
// createAt is the create time of the user
CreateAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=createAt,proto3" json:"createAt,omitempty"`
// status is the status of the user
Status UserStatus `protobuf:"varint,11,opt,name=status,proto3,enum=v1.UserStatus" json:"status,omitempty"`
// contains filtered or unexported fields
}
func (*ModifierExample) Default ¶
func (x *ModifierExample) Default()
func (*ModifierExample) Descriptor
deprecated
func (*ModifierExample) Descriptor() ([]byte, []int)
Deprecated: Use ModifierExample.ProtoReflect.Descriptor instead.
func (*ModifierExample) GetAddress ¶
func (x *ModifierExample) GetAddress() map[string]int64
func (*ModifierExample) GetContent ¶
func (x *ModifierExample) GetContent() []byte
func (*ModifierExample) GetCount ¶
func (x *ModifierExample) GetCount() int64
func (*ModifierExample) GetCreateAt ¶
func (x *ModifierExample) GetCreateAt() *timestamppb.Timestamp
func (*ModifierExample) GetHasEmail ¶
func (x *ModifierExample) GetHasEmail() bool
func (*ModifierExample) GetMoney ¶
func (x *ModifierExample) GetMoney() int32
func (*ModifierExample) GetNickname ¶
func (x *ModifierExample) GetNickname() string
func (*ModifierExample) GetPhones ¶
func (x *ModifierExample) GetPhones() []string
func (*ModifierExample) GetStatus ¶
func (x *ModifierExample) GetStatus() UserStatus
func (*ModifierExample) GetUsername ¶
func (x *ModifierExample) GetUsername() string
func (*ModifierExample) ProtoMessage ¶
func (*ModifierExample) ProtoMessage()
func (*ModifierExample) ProtoReflect ¶
func (x *ModifierExample) ProtoReflect() protoreflect.Message
func (*ModifierExample) Reset ¶
func (x *ModifierExample) Reset()
func (*ModifierExample) String ¶
func (x *ModifierExample) String() string
type Post ¶
type Post struct {
PostID string `protobuf:"bytes,1,opt,name=postID,proto3" json:"postID,omitempty"` // post id
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"` // user id
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // post title
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` // post content
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // post created time
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // post updated time
// contains filtered or unexported fields
}
Post is the post model
func (*Post) Descriptor
deprecated
func (*Post) GetContent ¶
func (*Post) GetCreatedAt ¶
func (x *Post) GetCreatedAt() *timestamppb.Timestamp
func (*Post) GetUpdatedAt ¶
func (x *Post) GetUpdatedAt() *timestamppb.Timestamp
func (*Post) ProtoMessage ¶
func (*Post) ProtoMessage()
func (*Post) ProtoReflect ¶
func (x *Post) ProtoReflect() protoreflect.Message
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
// contains filtered or unexported fields
}
RefreshTokenRequest is the request of RefreshToken
func (*RefreshTokenRequest) Default ¶
func (x *RefreshTokenRequest) Default()
func (*RefreshTokenRequest) Descriptor
deprecated
func (*RefreshTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.
func (*RefreshTokenRequest) ProtoMessage ¶
func (*RefreshTokenRequest) ProtoMessage()
func (*RefreshTokenRequest) ProtoReflect ¶
func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message
func (*RefreshTokenRequest) Reset ¶
func (x *RefreshTokenRequest) Reset()
func (*RefreshTokenRequest) String ¶
func (x *RefreshTokenRequest) String() string
type RefreshTokenResponse ¶
type RefreshTokenResponse struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // user token
ExpireAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expireAt,proto3" json:"expireAt,omitempty"` // token expire time
// contains filtered or unexported fields
}
RefreshTokenResponse is the response of RefreshToken
func (*RefreshTokenResponse) Default ¶
func (x *RefreshTokenResponse) Default()
func (*RefreshTokenResponse) Descriptor
deprecated
func (*RefreshTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead.
func (*RefreshTokenResponse) GetExpireAt ¶
func (x *RefreshTokenResponse) GetExpireAt() *timestamppb.Timestamp
func (*RefreshTokenResponse) GetToken ¶
func (x *RefreshTokenResponse) GetToken() string
func (*RefreshTokenResponse) ProtoMessage ¶
func (*RefreshTokenResponse) ProtoMessage()
func (*RefreshTokenResponse) ProtoReflect ¶
func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message
func (*RefreshTokenResponse) Reset ¶
func (x *RefreshTokenResponse) Reset()
func (*RefreshTokenResponse) String ¶
func (x *RefreshTokenResponse) String() string
type ServiceStatus ¶
type ServiceStatus int32
ServiceStatus means the server health status
const ( // ServiceStatusHealthy means the server health status is healthy ServiceStatus_ServiceStatusHealthy ServiceStatus = 0 // ServiceStatusUnhealthy means the server health status is unhealthy ServiceStatus_ServiceStatusUnhealthy ServiceStatus = 1 )
func (ServiceStatus) Descriptor ¶
func (ServiceStatus) Descriptor() protoreflect.EnumDescriptor
func (ServiceStatus) Enum ¶
func (x ServiceStatus) Enum() *ServiceStatus
func (ServiceStatus) EnumDescriptor
deprecated
func (ServiceStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ServiceStatus.Descriptor instead.
func (ServiceStatus) Number ¶
func (x ServiceStatus) Number() protoreflect.EnumNumber
func (ServiceStatus) String ¶
func (x ServiceStatus) String() string
func (ServiceStatus) Type ¶
func (ServiceStatus) Type() protoreflect.EnumType
type UnimplementedMiniBlogServer ¶
type UnimplementedMiniBlogServer struct{}
UnimplementedMiniBlogServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedMiniBlogServer) ChangePassword ¶
func (UnimplementedMiniBlogServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error)
func (UnimplementedMiniBlogServer) CreatePost ¶
func (UnimplementedMiniBlogServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
func (UnimplementedMiniBlogServer) CreateUser ¶
func (UnimplementedMiniBlogServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
func (UnimplementedMiniBlogServer) DeletePost ¶
func (UnimplementedMiniBlogServer) DeletePost(context.Context, *DeletePostRequest) (*DeletePostResponse, error)
func (UnimplementedMiniBlogServer) DeleteUser ¶
func (UnimplementedMiniBlogServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
func (UnimplementedMiniBlogServer) GetPost ¶
func (UnimplementedMiniBlogServer) GetPost(context.Context, *GetPostRequest) (*GetPostResponse, error)
func (UnimplementedMiniBlogServer) GetPostList ¶
func (UnimplementedMiniBlogServer) GetPostList(context.Context, *ListPostRequest) (*ListPostResponse, error)
func (UnimplementedMiniBlogServer) GetUser ¶
func (UnimplementedMiniBlogServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
func (UnimplementedMiniBlogServer) GetUserList ¶
func (UnimplementedMiniBlogServer) GetUserList(context.Context, *ListUserRequest) (*ListUserResponse, error)
func (UnimplementedMiniBlogServer) Healthz ¶
func (UnimplementedMiniBlogServer) Healthz(context.Context, *emptypb.Empty) (*HealthzResponse, error)
func (UnimplementedMiniBlogServer) Login ¶
func (UnimplementedMiniBlogServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (UnimplementedMiniBlogServer) RefreshToken ¶
func (UnimplementedMiniBlogServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
func (UnimplementedMiniBlogServer) UpdatePost ¶
func (UnimplementedMiniBlogServer) UpdatePost(context.Context, *UpdatePostRequest) (*UpdatePostResponse, error)
func (UnimplementedMiniBlogServer) UpdateUser ¶
func (UnimplementedMiniBlogServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
type UnsafeMiniBlogServer ¶
type UnsafeMiniBlogServer interface {
// contains filtered or unexported methods
}
UnsafeMiniBlogServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MiniBlogServer will result in compilation errors.
type UpdatePostRequest ¶
type UpdatePostRequest struct {
PostID string `protobuf:"bytes,1,opt,name=postID,proto3" json:"postID,omitempty"` // post id
Title *string `protobuf:"bytes,2,opt,name=title,proto3,oneof" json:"title,omitempty"` // post title
Content *string `protobuf:"bytes,3,opt,name=content,proto3,oneof" json:"content,omitempty"` // post content
// contains filtered or unexported fields
}
UpdatePostRequest is the request of UpdatePost
func (*UpdatePostRequest) Default ¶
func (x *UpdatePostRequest) Default()
func (*UpdatePostRequest) Descriptor
deprecated
func (*UpdatePostRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePostRequest.ProtoReflect.Descriptor instead.
func (*UpdatePostRequest) GetContent ¶
func (x *UpdatePostRequest) GetContent() string
func (*UpdatePostRequest) GetPostID ¶
func (x *UpdatePostRequest) GetPostID() string
func (*UpdatePostRequest) GetTitle ¶
func (x *UpdatePostRequest) GetTitle() string
func (*UpdatePostRequest) ProtoMessage ¶
func (*UpdatePostRequest) ProtoMessage()
func (*UpdatePostRequest) ProtoReflect ¶
func (x *UpdatePostRequest) ProtoReflect() protoreflect.Message
func (*UpdatePostRequest) Reset ¶
func (x *UpdatePostRequest) Reset()
func (*UpdatePostRequest) String ¶
func (x *UpdatePostRequest) String() string
type UpdatePostResponse ¶
type UpdatePostResponse struct {
// contains filtered or unexported fields
}
UpdatePostResponse is the response of UpdatePost
func (*UpdatePostResponse) Default ¶
func (x *UpdatePostResponse) Default()
func (*UpdatePostResponse) Descriptor
deprecated
func (*UpdatePostResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePostResponse.ProtoReflect.Descriptor instead.
func (*UpdatePostResponse) ProtoMessage ¶
func (*UpdatePostResponse) ProtoMessage()
func (*UpdatePostResponse) ProtoReflect ¶
func (x *UpdatePostResponse) ProtoReflect() protoreflect.Message
func (*UpdatePostResponse) Reset ¶
func (x *UpdatePostResponse) Reset()
func (*UpdatePostResponse) String ¶
func (x *UpdatePostResponse) String() string
type UpdateUserRequest ¶
type UpdateUserRequest struct {
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` // user id
Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` // user name
Nickname *string `protobuf:"bytes,3,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"` // user nickname
Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` // user email
Phone *string `protobuf:"bytes,5,opt,name=phone,proto3,oneof" json:"phone,omitempty"` // user phone
// contains filtered or unexported fields
}
UpdateUserRequest is the request of UpdateUser
func (*UpdateUserRequest) Default ¶
func (x *UpdateUserRequest) Default()
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetEmail ¶
func (x *UpdateUserRequest) GetEmail() string
func (*UpdateUserRequest) GetNickname ¶
func (x *UpdateUserRequest) GetNickname() string
func (*UpdateUserRequest) GetPhone ¶
func (x *UpdateUserRequest) GetPhone() string
func (*UpdateUserRequest) GetUserID ¶
func (x *UpdateUserRequest) GetUserID() string
func (*UpdateUserRequest) GetUsername ¶
func (x *UpdateUserRequest) GetUsername() string
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
type UpdateUserResponse ¶
type UpdateUserResponse struct {
// contains filtered or unexported fields
}
UpdateUserResponse is the response of UpdateUser
func (*UpdateUserResponse) Default ¶
func (x *UpdateUserResponse) Default()
func (*UpdateUserResponse) Descriptor
deprecated
func (*UpdateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserResponse) ProtoMessage ¶
func (*UpdateUserResponse) ProtoMessage()
func (*UpdateUserResponse) ProtoReflect ¶
func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message
func (*UpdateUserResponse) Reset ¶
func (x *UpdateUserResponse) Reset()
func (*UpdateUserResponse) String ¶
func (x *UpdateUserResponse) String() string
type User ¶
type User struct {
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` // user id
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // user name
Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"` // user nickname
Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` // user email
Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` // user phone
PostCount int64 `protobuf:"varint,6,opt,name=postCount,proto3" json:"postCount,omitempty"` // user post count
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"` // user created time
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"` // user updated time
// contains filtered or unexported fields
}
User is the user model
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (x *User) GetCreatedAt() *timestamppb.Timestamp
func (*User) GetNickname ¶
func (*User) GetPostCount ¶
func (*User) GetUpdatedAt ¶
func (x *User) GetUpdatedAt() *timestamppb.Timestamp
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserStatus ¶
type UserStatus int32
const ( // Active means the user is active UserStatus_Active UserStatus = 0 // Inactive means the user is inactive UserStatus_Inactive UserStatus = 1 // Banned means the user is banned UserStatus_Banned UserStatus = 2 )
func (UserStatus) Descriptor ¶
func (UserStatus) Descriptor() protoreflect.EnumDescriptor
func (UserStatus) Enum ¶
func (x UserStatus) Enum() *UserStatus
func (UserStatus) EnumDescriptor
deprecated
func (UserStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use UserStatus.Descriptor instead.
func (UserStatus) Number ¶
func (x UserStatus) Number() protoreflect.EnumNumber
func (UserStatus) String ¶
func (x UserStatus) String() string
func (UserStatus) Type ¶
func (UserStatus) Type() protoreflect.EnumType