2023-07-30 01:35:00 +08:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/user_service.proto
package apiv2
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
const (
2023-09-14 19:18:54 +08:00
UserService_GetUser_FullMethodName = "/memos.api.v2.UserService/GetUser"
2023-10-21 12:19:06 +08:00
UserService_CreateUser_FullMethodName = "/memos.api.v2.UserService/CreateUser"
2023-09-14 19:18:54 +08:00
UserService_UpdateUser_FullMethodName = "/memos.api.v2.UserService/UpdateUser"
2023-11-22 22:52:19 +08:00
UserService_DeleteUser_FullMethodName = "/memos.api.v2.UserService/DeleteUser"
2023-12-01 09:03:30 +08:00
UserService_GetUserSetting_FullMethodName = "/memos.api.v2.UserService/GetUserSetting"
UserService_UpdateUserSetting_FullMethodName = "/memos.api.v2.UserService/UpdateUserSetting"
2023-09-14 19:18:54 +08:00
UserService_ListUserAccessTokens_FullMethodName = "/memos.api.v2.UserService/ListUserAccessTokens"
UserService_CreateUserAccessToken_FullMethodName = "/memos.api.v2.UserService/CreateUserAccessToken"
UserService_DeleteUserAccessToken_FullMethodName = "/memos.api.v2.UserService/DeleteUserAccessToken"
2023-07-30 01:35:00 +08:00
)
// UserServiceClient is the client API for UserService 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.
type UserServiceClient interface {
2023-11-22 22:52:19 +08:00
// GetUser gets a user by name.
2023-07-30 01:35:00 +08:00
GetUser ( ctx context . Context , in * GetUserRequest , opts ... grpc . CallOption ) ( * GetUserResponse , error )
2023-11-22 22:52:19 +08:00
// CreateUser creates a new user.
2023-10-21 12:19:06 +08:00
CreateUser ( ctx context . Context , in * CreateUserRequest , opts ... grpc . CallOption ) ( * CreateUserResponse , error )
2023-11-22 22:52:19 +08:00
// UpdateUser updates a user.
2023-09-10 18:56:24 +08:00
UpdateUser ( ctx context . Context , in * UpdateUserRequest , opts ... grpc . CallOption ) ( * UpdateUserResponse , error )
2023-11-22 22:52:19 +08:00
// DeleteUser deletes a user.
DeleteUser ( ctx context . Context , in * DeleteUserRequest , opts ... grpc . CallOption ) ( * DeleteUserResponse , error )
2023-12-01 09:03:30 +08:00
GetUserSetting ( ctx context . Context , in * GetUserSettingRequest , opts ... grpc . CallOption ) ( * GetUserSettingResponse , error )
UpdateUserSetting ( ctx context . Context , in * UpdateUserSettingRequest , opts ... grpc . CallOption ) ( * UpdateUserSettingResponse , error )
2023-09-14 19:18:54 +08:00
// ListUserAccessTokens returns a list of access tokens for a user.
ListUserAccessTokens ( ctx context . Context , in * ListUserAccessTokensRequest , opts ... grpc . CallOption ) ( * ListUserAccessTokensResponse , error )
// CreateUserAccessToken creates a new access token for a user.
CreateUserAccessToken ( ctx context . Context , in * CreateUserAccessTokenRequest , opts ... grpc . CallOption ) ( * CreateUserAccessTokenResponse , error )
// DeleteUserAccessToken deletes an access token for a user.
DeleteUserAccessToken ( ctx context . Context , in * DeleteUserAccessTokenRequest , opts ... grpc . CallOption ) ( * DeleteUserAccessTokenResponse , error )
2023-07-30 01:35:00 +08:00
}
type userServiceClient struct {
cc grpc . ClientConnInterface
}
func NewUserServiceClient ( cc grpc . ClientConnInterface ) UserServiceClient {
return & userServiceClient { cc }
}
func ( c * userServiceClient ) GetUser ( ctx context . Context , in * GetUserRequest , opts ... grpc . CallOption ) ( * GetUserResponse , error ) {
out := new ( GetUserResponse )
err := c . cc . Invoke ( ctx , UserService_GetUser_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-10-21 12:19:06 +08:00
func ( c * userServiceClient ) CreateUser ( ctx context . Context , in * CreateUserRequest , opts ... grpc . CallOption ) ( * CreateUserResponse , error ) {
out := new ( CreateUserResponse )
err := c . cc . Invoke ( ctx , UserService_CreateUser_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-09-10 18:56:24 +08:00
func ( c * userServiceClient ) UpdateUser ( ctx context . Context , in * UpdateUserRequest , opts ... grpc . CallOption ) ( * UpdateUserResponse , error ) {
out := new ( UpdateUserResponse )
err := c . cc . Invoke ( ctx , UserService_UpdateUser_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-11-22 22:52:19 +08:00
func ( c * userServiceClient ) DeleteUser ( ctx context . Context , in * DeleteUserRequest , opts ... grpc . CallOption ) ( * DeleteUserResponse , error ) {
out := new ( DeleteUserResponse )
err := c . cc . Invoke ( ctx , UserService_DeleteUser_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-12-01 09:03:30 +08:00
func ( c * userServiceClient ) GetUserSetting ( ctx context . Context , in * GetUserSettingRequest , opts ... grpc . CallOption ) ( * GetUserSettingResponse , error ) {
out := new ( GetUserSettingResponse )
err := c . cc . Invoke ( ctx , UserService_GetUserSetting_FullMethodName , in , out , opts ... )
2023-11-30 23:08:54 +08:00
if err != nil {
return nil , err
}
return out , nil
}
2023-12-01 09:03:30 +08:00
func ( c * userServiceClient ) UpdateUserSetting ( ctx context . Context , in * UpdateUserSettingRequest , opts ... grpc . CallOption ) ( * UpdateUserSettingResponse , error ) {
out := new ( UpdateUserSettingResponse )
err := c . cc . Invoke ( ctx , UserService_UpdateUserSetting_FullMethodName , in , out , opts ... )
2023-11-30 23:08:54 +08:00
if err != nil {
return nil , err
}
return out , nil
}
2023-09-14 19:18:54 +08:00
func ( c * userServiceClient ) ListUserAccessTokens ( ctx context . Context , in * ListUserAccessTokensRequest , opts ... grpc . CallOption ) ( * ListUserAccessTokensResponse , error ) {
out := new ( ListUserAccessTokensResponse )
err := c . cc . Invoke ( ctx , UserService_ListUserAccessTokens_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * userServiceClient ) CreateUserAccessToken ( ctx context . Context , in * CreateUserAccessTokenRequest , opts ... grpc . CallOption ) ( * CreateUserAccessTokenResponse , error ) {
out := new ( CreateUserAccessTokenResponse )
err := c . cc . Invoke ( ctx , UserService_CreateUserAccessToken_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * userServiceClient ) DeleteUserAccessToken ( ctx context . Context , in * DeleteUserAccessTokenRequest , opts ... grpc . CallOption ) ( * DeleteUserAccessTokenResponse , error ) {
out := new ( DeleteUserAccessTokenResponse )
err := c . cc . Invoke ( ctx , UserService_DeleteUserAccessToken_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-07-30 01:35:00 +08:00
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
// for forward compatibility
type UserServiceServer interface {
2023-11-22 22:52:19 +08:00
// GetUser gets a user by name.
2023-07-30 01:35:00 +08:00
GetUser ( context . Context , * GetUserRequest ) ( * GetUserResponse , error )
2023-11-22 22:52:19 +08:00
// CreateUser creates a new user.
2023-10-21 12:19:06 +08:00
CreateUser ( context . Context , * CreateUserRequest ) ( * CreateUserResponse , error )
2023-11-22 22:52:19 +08:00
// UpdateUser updates a user.
2023-09-10 18:56:24 +08:00
UpdateUser ( context . Context , * UpdateUserRequest ) ( * UpdateUserResponse , error )
2023-11-22 22:52:19 +08:00
// DeleteUser deletes a user.
DeleteUser ( context . Context , * DeleteUserRequest ) ( * DeleteUserResponse , error )
2023-12-01 09:03:30 +08:00
GetUserSetting ( context . Context , * GetUserSettingRequest ) ( * GetUserSettingResponse , error )
UpdateUserSetting ( context . Context , * UpdateUserSettingRequest ) ( * UpdateUserSettingResponse , error )
2023-09-14 19:18:54 +08:00
// ListUserAccessTokens returns a list of access tokens for a user.
ListUserAccessTokens ( context . Context , * ListUserAccessTokensRequest ) ( * ListUserAccessTokensResponse , error )
// CreateUserAccessToken creates a new access token for a user.
CreateUserAccessToken ( context . Context , * CreateUserAccessTokenRequest ) ( * CreateUserAccessTokenResponse , error )
// DeleteUserAccessToken deletes an access token for a user.
DeleteUserAccessToken ( context . Context , * DeleteUserAccessTokenRequest ) ( * DeleteUserAccessTokenResponse , error )
2023-07-30 01:35:00 +08:00
mustEmbedUnimplementedUserServiceServer ( )
}
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}
func ( UnimplementedUserServiceServer ) GetUser ( context . Context , * GetUserRequest ) ( * GetUserResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetUser not implemented" )
}
2023-10-21 12:19:06 +08:00
func ( UnimplementedUserServiceServer ) CreateUser ( context . Context , * CreateUserRequest ) ( * CreateUserResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method CreateUser not implemented" )
}
2023-09-10 18:56:24 +08:00
func ( UnimplementedUserServiceServer ) UpdateUser ( context . Context , * UpdateUserRequest ) ( * UpdateUserResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method UpdateUser not implemented" )
}
2023-11-22 22:52:19 +08:00
func ( UnimplementedUserServiceServer ) DeleteUser ( context . Context , * DeleteUserRequest ) ( * DeleteUserResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method DeleteUser not implemented" )
}
2023-12-01 09:03:30 +08:00
func ( UnimplementedUserServiceServer ) GetUserSetting ( context . Context , * GetUserSettingRequest ) ( * GetUserSettingResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetUserSetting not implemented" )
2023-11-30 23:08:54 +08:00
}
2023-12-01 09:03:30 +08:00
func ( UnimplementedUserServiceServer ) UpdateUserSetting ( context . Context , * UpdateUserSettingRequest ) ( * UpdateUserSettingResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method UpdateUserSetting not implemented" )
2023-11-30 23:08:54 +08:00
}
2023-09-14 19:18:54 +08:00
func ( UnimplementedUserServiceServer ) ListUserAccessTokens ( context . Context , * ListUserAccessTokensRequest ) ( * ListUserAccessTokensResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ListUserAccessTokens not implemented" )
}
func ( UnimplementedUserServiceServer ) CreateUserAccessToken ( context . Context , * CreateUserAccessTokenRequest ) ( * CreateUserAccessTokenResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method CreateUserAccessToken not implemented" )
}
func ( UnimplementedUserServiceServer ) DeleteUserAccessToken ( context . Context , * DeleteUserAccessTokenRequest ) ( * DeleteUserAccessTokenResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method DeleteUserAccessToken not implemented" )
}
2023-07-30 01:35:00 +08:00
func ( UnimplementedUserServiceServer ) mustEmbedUnimplementedUserServiceServer ( ) { }
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServiceServer will
// result in compilation errors.
type UnsafeUserServiceServer interface {
mustEmbedUnimplementedUserServiceServer ( )
}
func RegisterUserServiceServer ( s grpc . ServiceRegistrar , srv UserServiceServer ) {
s . RegisterService ( & UserService_ServiceDesc , srv )
}
func _UserService_GetUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . GetUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_GetUser_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . GetUser ( ctx , req . ( * GetUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-10-21 12:19:06 +08:00
func _UserService_CreateUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CreateUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . CreateUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_CreateUser_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . CreateUser ( ctx , req . ( * CreateUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-09-10 18:56:24 +08:00
func _UserService_UpdateUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( UpdateUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . UpdateUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_UpdateUser_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . UpdateUser ( ctx , req . ( * UpdateUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-11-22 22:52:19 +08:00
func _UserService_DeleteUser_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( DeleteUserRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . DeleteUser ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_DeleteUser_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . DeleteUser ( ctx , req . ( * DeleteUserRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-12-01 09:03:30 +08:00
func _UserService_GetUserSetting_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetUserSettingRequest )
2023-11-30 23:08:54 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2023-12-01 09:03:30 +08:00
return srv . ( UserServiceServer ) . GetUserSetting ( ctx , in )
2023-11-30 23:08:54 +08:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-12-01 09:03:30 +08:00
FullMethod : UserService_GetUserSetting_FullMethodName ,
2023-11-30 23:08:54 +08:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2023-12-01 09:03:30 +08:00
return srv . ( UserServiceServer ) . GetUserSetting ( ctx , req . ( * GetUserSettingRequest ) )
2023-11-30 23:08:54 +08:00
}
return interceptor ( ctx , in , info , handler )
}
2023-12-01 09:03:30 +08:00
func _UserService_UpdateUserSetting_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( UpdateUserSettingRequest )
2023-11-30 23:08:54 +08:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2023-12-01 09:03:30 +08:00
return srv . ( UserServiceServer ) . UpdateUserSetting ( ctx , in )
2023-11-30 23:08:54 +08:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-12-01 09:03:30 +08:00
FullMethod : UserService_UpdateUserSetting_FullMethodName ,
2023-11-30 23:08:54 +08:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2023-12-01 09:03:30 +08:00
return srv . ( UserServiceServer ) . UpdateUserSetting ( ctx , req . ( * UpdateUserSettingRequest ) )
2023-11-30 23:08:54 +08:00
}
return interceptor ( ctx , in , info , handler )
}
2023-09-14 19:18:54 +08:00
func _UserService_ListUserAccessTokens_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ListUserAccessTokensRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . ListUserAccessTokens ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_ListUserAccessTokens_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . ListUserAccessTokens ( ctx , req . ( * ListUserAccessTokensRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _UserService_CreateUserAccessToken_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CreateUserAccessTokenRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . CreateUserAccessToken ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_CreateUserAccessToken_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . CreateUserAccessToken ( ctx , req . ( * CreateUserAccessTokenRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _UserService_DeleteUserAccessToken_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( DeleteUserAccessTokenRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( UserServiceServer ) . DeleteUserAccessToken ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : UserService_DeleteUserAccessToken_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( UserServiceServer ) . DeleteUserAccessToken ( ctx , req . ( * DeleteUserAccessTokenRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-07-30 01:35:00 +08:00
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "memos.api.v2.UserService" ,
HandlerType : ( * UserServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "GetUser" ,
Handler : _UserService_GetUser_Handler ,
} ,
2023-10-21 12:19:06 +08:00
{
MethodName : "CreateUser" ,
Handler : _UserService_CreateUser_Handler ,
} ,
2023-09-10 18:56:24 +08:00
{
MethodName : "UpdateUser" ,
Handler : _UserService_UpdateUser_Handler ,
} ,
2023-11-22 22:52:19 +08:00
{
MethodName : "DeleteUser" ,
Handler : _UserService_DeleteUser_Handler ,
} ,
2023-11-30 23:08:54 +08:00
{
2023-12-01 09:03:30 +08:00
MethodName : "GetUserSetting" ,
Handler : _UserService_GetUserSetting_Handler ,
2023-11-30 23:08:54 +08:00
} ,
{
2023-12-01 09:03:30 +08:00
MethodName : "UpdateUserSetting" ,
Handler : _UserService_UpdateUserSetting_Handler ,
2023-11-30 23:08:54 +08:00
} ,
2023-09-14 19:18:54 +08:00
{
MethodName : "ListUserAccessTokens" ,
Handler : _UserService_ListUserAccessTokens_Handler ,
} ,
{
MethodName : "CreateUserAccessToken" ,
Handler : _UserService_CreateUserAccessToken_Handler ,
} ,
{
MethodName : "DeleteUserAccessToken" ,
Handler : _UserService_DeleteUserAccessToken_Handler ,
} ,
2023-07-30 01:35:00 +08:00
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "api/v2/user_service.proto" ,
}