2023-09-16 00:11:07 +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/resource_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 (
2024-01-21 21:27:04 +08:00
ResourceService_CreateResource_FullMethodName = "/memos.api.v2.ResourceService/CreateResource"
ResourceService_ListResources_FullMethodName = "/memos.api.v2.ResourceService/ListResources"
ResourceService_GetResource_FullMethodName = "/memos.api.v2.ResourceService/GetResource"
ResourceService_GetResourceByName_FullMethodName = "/memos.api.v2.ResourceService/GetResourceByName"
ResourceService_UpdateResource_FullMethodName = "/memos.api.v2.ResourceService/UpdateResource"
ResourceService_DeleteResource_FullMethodName = "/memos.api.v2.ResourceService/DeleteResource"
2023-09-16 00:11:07 +08:00
)
// ResourceServiceClient is the client API for ResourceService 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 ResourceServiceClient interface {
2023-10-03 23:44:14 +08:00
CreateResource ( ctx context . Context , in * CreateResourceRequest , opts ... grpc . CallOption ) ( * CreateResourceResponse , error )
2023-09-16 00:11:07 +08:00
ListResources ( ctx context . Context , in * ListResourcesRequest , opts ... grpc . CallOption ) ( * ListResourcesResponse , error )
2024-01-20 09:17:31 +08:00
GetResource ( ctx context . Context , in * GetResourceRequest , opts ... grpc . CallOption ) ( * GetResourceResponse , error )
2024-01-21 21:27:04 +08:00
GetResourceByName ( ctx context . Context , in * GetResourceByNameRequest , opts ... grpc . CallOption ) ( * GetResourceByNameResponse , error )
2023-10-03 23:44:14 +08:00
UpdateResource ( ctx context . Context , in * UpdateResourceRequest , opts ... grpc . CallOption ) ( * UpdateResourceResponse , error )
2023-09-27 08:09:30 +08:00
DeleteResource ( ctx context . Context , in * DeleteResourceRequest , opts ... grpc . CallOption ) ( * DeleteResourceResponse , error )
2023-09-16 00:11:07 +08:00
}
type resourceServiceClient struct {
cc grpc . ClientConnInterface
}
func NewResourceServiceClient ( cc grpc . ClientConnInterface ) ResourceServiceClient {
return & resourceServiceClient { cc }
}
2023-10-03 23:44:14 +08:00
func ( c * resourceServiceClient ) CreateResource ( ctx context . Context , in * CreateResourceRequest , opts ... grpc . CallOption ) ( * CreateResourceResponse , error ) {
out := new ( CreateResourceResponse )
err := c . cc . Invoke ( ctx , ResourceService_CreateResource_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-09-16 00:11:07 +08:00
func ( c * resourceServiceClient ) ListResources ( ctx context . Context , in * ListResourcesRequest , opts ... grpc . CallOption ) ( * ListResourcesResponse , error ) {
out := new ( ListResourcesResponse )
err := c . cc . Invoke ( ctx , ResourceService_ListResources_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2024-01-20 09:17:31 +08:00
func ( c * resourceServiceClient ) GetResource ( ctx context . Context , in * GetResourceRequest , opts ... grpc . CallOption ) ( * GetResourceResponse , error ) {
out := new ( GetResourceResponse )
err := c . cc . Invoke ( ctx , ResourceService_GetResource_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2024-01-21 21:27:04 +08:00
func ( c * resourceServiceClient ) GetResourceByName ( ctx context . Context , in * GetResourceByNameRequest , opts ... grpc . CallOption ) ( * GetResourceByNameResponse , error ) {
out := new ( GetResourceByNameResponse )
err := c . cc . Invoke ( ctx , ResourceService_GetResourceByName_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-10-03 23:44:14 +08:00
func ( c * resourceServiceClient ) UpdateResource ( ctx context . Context , in * UpdateResourceRequest , opts ... grpc . CallOption ) ( * UpdateResourceResponse , error ) {
out := new ( UpdateResourceResponse )
err := c . cc . Invoke ( ctx , ResourceService_UpdateResource_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-09-27 08:09:30 +08:00
func ( c * resourceServiceClient ) DeleteResource ( ctx context . Context , in * DeleteResourceRequest , opts ... grpc . CallOption ) ( * DeleteResourceResponse , error ) {
out := new ( DeleteResourceResponse )
err := c . cc . Invoke ( ctx , ResourceService_DeleteResource_FullMethodName , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-09-16 00:11:07 +08:00
// ResourceServiceServer is the server API for ResourceService service.
// All implementations must embed UnimplementedResourceServiceServer
// for forward compatibility
type ResourceServiceServer interface {
2023-10-03 23:44:14 +08:00
CreateResource ( context . Context , * CreateResourceRequest ) ( * CreateResourceResponse , error )
2023-09-16 00:11:07 +08:00
ListResources ( context . Context , * ListResourcesRequest ) ( * ListResourcesResponse , error )
2024-01-20 09:17:31 +08:00
GetResource ( context . Context , * GetResourceRequest ) ( * GetResourceResponse , error )
2024-01-21 21:27:04 +08:00
GetResourceByName ( context . Context , * GetResourceByNameRequest ) ( * GetResourceByNameResponse , error )
2023-10-03 23:44:14 +08:00
UpdateResource ( context . Context , * UpdateResourceRequest ) ( * UpdateResourceResponse , error )
2023-09-27 08:09:30 +08:00
DeleteResource ( context . Context , * DeleteResourceRequest ) ( * DeleteResourceResponse , error )
2023-09-16 00:11:07 +08:00
mustEmbedUnimplementedResourceServiceServer ( )
}
// UnimplementedResourceServiceServer must be embedded to have forward compatible implementations.
type UnimplementedResourceServiceServer struct {
}
2023-10-03 23:44:14 +08:00
func ( UnimplementedResourceServiceServer ) CreateResource ( context . Context , * CreateResourceRequest ) ( * CreateResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method CreateResource not implemented" )
}
2023-09-16 00:11:07 +08:00
func ( UnimplementedResourceServiceServer ) ListResources ( context . Context , * ListResourcesRequest ) ( * ListResourcesResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ListResources not implemented" )
}
2024-01-20 09:17:31 +08:00
func ( UnimplementedResourceServiceServer ) GetResource ( context . Context , * GetResourceRequest ) ( * GetResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetResource not implemented" )
}
2024-01-21 21:27:04 +08:00
func ( UnimplementedResourceServiceServer ) GetResourceByName ( context . Context , * GetResourceByNameRequest ) ( * GetResourceByNameResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetResourceByName not implemented" )
}
2023-10-03 23:44:14 +08:00
func ( UnimplementedResourceServiceServer ) UpdateResource ( context . Context , * UpdateResourceRequest ) ( * UpdateResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method UpdateResource not implemented" )
}
2023-09-27 08:09:30 +08:00
func ( UnimplementedResourceServiceServer ) DeleteResource ( context . Context , * DeleteResourceRequest ) ( * DeleteResourceResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method DeleteResource not implemented" )
}
2023-09-16 00:11:07 +08:00
func ( UnimplementedResourceServiceServer ) mustEmbedUnimplementedResourceServiceServer ( ) { }
// UnsafeResourceServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ResourceServiceServer will
// result in compilation errors.
type UnsafeResourceServiceServer interface {
mustEmbedUnimplementedResourceServiceServer ( )
}
func RegisterResourceServiceServer ( s grpc . ServiceRegistrar , srv ResourceServiceServer ) {
s . RegisterService ( & ResourceService_ServiceDesc , srv )
}
2023-10-03 23:44:14 +08:00
func _ResourceService_CreateResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( CreateResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . CreateResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_CreateResource_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . CreateResource ( ctx , req . ( * CreateResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-09-16 00:11:07 +08:00
func _ResourceService_ListResources_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ListResourcesRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . ListResources ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_ListResources_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . ListResources ( ctx , req . ( * ListResourcesRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2024-01-20 09:17:31 +08:00
func _ResourceService_GetResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . GetResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_GetResource_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . GetResource ( ctx , req . ( * GetResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2024-01-21 21:27:04 +08:00
func _ResourceService_GetResourceByName_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetResourceByNameRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . GetResourceByName ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_GetResourceByName_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . GetResourceByName ( ctx , req . ( * GetResourceByNameRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-10-03 23:44:14 +08:00
func _ResourceService_UpdateResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( UpdateResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . UpdateResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_UpdateResource_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . UpdateResource ( ctx , req . ( * UpdateResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-09-27 08:09:30 +08:00
func _ResourceService_DeleteResource_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( DeleteResourceRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . DeleteResource ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : ResourceService_DeleteResource_FullMethodName ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . DeleteResource ( ctx , req . ( * DeleteResourceRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-09-16 00:11:07 +08:00
// ResourceService_ServiceDesc is the grpc.ServiceDesc for ResourceService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ResourceService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "memos.api.v2.ResourceService" ,
HandlerType : ( * ResourceServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
2023-10-03 23:44:14 +08:00
{
MethodName : "CreateResource" ,
Handler : _ResourceService_CreateResource_Handler ,
} ,
2023-09-16 00:11:07 +08:00
{
MethodName : "ListResources" ,
Handler : _ResourceService_ListResources_Handler ,
} ,
2024-01-20 09:17:31 +08:00
{
MethodName : "GetResource" ,
Handler : _ResourceService_GetResource_Handler ,
} ,
2024-01-21 21:27:04 +08:00
{
MethodName : "GetResourceByName" ,
Handler : _ResourceService_GetResourceByName_Handler ,
} ,
2023-10-03 23:44:14 +08:00
{
MethodName : "UpdateResource" ,
Handler : _ResourceService_UpdateResource_Handler ,
} ,
2023-09-27 08:09:30 +08:00
{
MethodName : "DeleteResource" ,
Handler : _ResourceService_DeleteResource_Handler ,
} ,
2023-09-16 00:11:07 +08:00
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "api/v2/resource_service.proto" ,
}