2023-03-09 19:40:23 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: pbresource/resource.proto
package pbresource
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
// 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 {
Read ( ctx context . Context , in * ReadRequest , opts ... grpc . CallOption ) ( * ReadResponse , error )
Write ( ctx context . Context , in * WriteRequest , opts ... grpc . CallOption ) ( * WriteResponse , error )
WriteStatus ( ctx context . Context , in * WriteStatusRequest , opts ... grpc . CallOption ) ( * WriteStatusResponse , error )
List ( ctx context . Context , in * ListRequest , opts ... grpc . CallOption ) ( * ListResponse , error )
Delete ( ctx context . Context , in * DeleteRequest , opts ... grpc . CallOption ) ( * DeleteResponse , error )
2023-03-27 19:37:54 +00:00
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
WatchList ( ctx context . Context , in * WatchListRequest , opts ... grpc . CallOption ) ( ResourceService_WatchListClient , error )
2023-03-09 19:40:23 +00:00
}
type resourceServiceClient struct {
cc grpc . ClientConnInterface
}
func NewResourceServiceClient ( cc grpc . ClientConnInterface ) ResourceServiceClient {
return & resourceServiceClient { cc }
}
func ( c * resourceServiceClient ) Read ( ctx context . Context , in * ReadRequest , opts ... grpc . CallOption ) ( * ReadResponse , error ) {
out := new ( ReadResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.resource.ResourceService/Read" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceServiceClient ) Write ( ctx context . Context , in * WriteRequest , opts ... grpc . CallOption ) ( * WriteResponse , error ) {
out := new ( WriteResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.resource.ResourceService/Write" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceServiceClient ) WriteStatus ( ctx context . Context , in * WriteStatusRequest , opts ... grpc . CallOption ) ( * WriteStatusResponse , error ) {
out := new ( WriteStatusResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.resource.ResourceService/WriteStatus" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceServiceClient ) List ( ctx context . Context , in * ListRequest , opts ... grpc . CallOption ) ( * ListResponse , error ) {
out := new ( ListResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.resource.ResourceService/List" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * resourceServiceClient ) Delete ( ctx context . Context , in * DeleteRequest , opts ... grpc . CallOption ) ( * DeleteResponse , error ) {
out := new ( DeleteResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.resource.ResourceService/Delete" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-03-27 19:37:54 +00:00
func ( c * resourceServiceClient ) WatchList ( ctx context . Context , in * WatchListRequest , opts ... grpc . CallOption ) ( ResourceService_WatchListClient , error ) {
stream , err := c . cc . NewStream ( ctx , & ResourceService_ServiceDesc . Streams [ 0 ] , "/hashicorp.consul.resource.ResourceService/WatchList" , opts ... )
2023-03-09 19:40:23 +00:00
if err != nil {
return nil , err
}
2023-03-27 19:37:54 +00:00
x := & resourceServiceWatchListClient { stream }
2023-03-09 19:40:23 +00:00
if err := x . ClientStream . SendMsg ( in ) ; err != nil {
return nil , err
}
if err := x . ClientStream . CloseSend ( ) ; err != nil {
return nil , err
}
return x , nil
}
2023-03-27 19:37:54 +00:00
type ResourceService_WatchListClient interface {
Recv ( ) ( * WatchEvent , error )
2023-03-09 19:40:23 +00:00
grpc . ClientStream
}
2023-03-27 19:37:54 +00:00
type resourceServiceWatchListClient struct {
2023-03-09 19:40:23 +00:00
grpc . ClientStream
}
2023-03-27 19:37:54 +00:00
func ( x * resourceServiceWatchListClient ) Recv ( ) ( * WatchEvent , error ) {
m := new ( WatchEvent )
2023-03-09 19:40:23 +00:00
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
// ResourceServiceServer is the server API for ResourceService service.
// All implementations should embed UnimplementedResourceServiceServer
// for forward compatibility
type ResourceServiceServer interface {
Read ( context . Context , * ReadRequest ) ( * ReadResponse , error )
Write ( context . Context , * WriteRequest ) ( * WriteResponse , error )
WriteStatus ( context . Context , * WriteStatusRequest ) ( * WriteStatusResponse , error )
List ( context . Context , * ListRequest ) ( * ListResponse , error )
Delete ( context . Context , * DeleteRequest ) ( * DeleteResponse , error )
2023-03-27 19:37:54 +00:00
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
WatchList ( * WatchListRequest , ResourceService_WatchListServer ) error
2023-03-09 19:40:23 +00:00
}
// UnimplementedResourceServiceServer should be embedded to have forward compatible implementations.
type UnimplementedResourceServiceServer struct {
}
func ( UnimplementedResourceServiceServer ) Read ( context . Context , * ReadRequest ) ( * ReadResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Read not implemented" )
}
func ( UnimplementedResourceServiceServer ) Write ( context . Context , * WriteRequest ) ( * WriteResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Write not implemented" )
}
func ( UnimplementedResourceServiceServer ) WriteStatus ( context . Context , * WriteStatusRequest ) ( * WriteStatusResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method WriteStatus not implemented" )
}
func ( UnimplementedResourceServiceServer ) List ( context . Context , * ListRequest ) ( * ListResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method List not implemented" )
}
func ( UnimplementedResourceServiceServer ) Delete ( context . Context , * DeleteRequest ) ( * DeleteResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method Delete not implemented" )
}
2023-03-27 19:37:54 +00:00
func ( UnimplementedResourceServiceServer ) WatchList ( * WatchListRequest , ResourceService_WatchListServer ) error {
return status . Errorf ( codes . Unimplemented , "method WatchList not implemented" )
2023-03-09 19:40:23 +00:00
}
// 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 )
}
func _ResourceService_Read_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ReadRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . Read ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.resource.ResourceService/Read" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . Read ( ctx , req . ( * ReadRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceService_Write_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( WriteRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . Write ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.resource.ResourceService/Write" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . Write ( ctx , req . ( * WriteRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceService_WriteStatus_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( WriteStatusRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . WriteStatus ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.resource.ResourceService/WriteStatus" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . WriteStatus ( ctx , req . ( * WriteStatusRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceService_List_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ListRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . List ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.resource.ResourceService/List" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . List ( ctx , req . ( * ListRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ResourceService_Delete_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( DeleteRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ResourceServiceServer ) . Delete ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.resource.ResourceService/Delete" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ResourceServiceServer ) . Delete ( ctx , req . ( * DeleteRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-03-27 19:37:54 +00:00
func _ResourceService_WatchList_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( WatchListRequest )
2023-03-09 19:40:23 +00:00
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
2023-03-27 19:37:54 +00:00
return srv . ( ResourceServiceServer ) . WatchList ( m , & resourceServiceWatchListServer { stream } )
2023-03-09 19:40:23 +00:00
}
2023-03-27 19:37:54 +00:00
type ResourceService_WatchListServer interface {
Send ( * WatchEvent ) error
2023-03-09 19:40:23 +00:00
grpc . ServerStream
}
2023-03-27 19:37:54 +00:00
type resourceServiceWatchListServer struct {
2023-03-09 19:40:23 +00:00
grpc . ServerStream
}
2023-03-27 19:37:54 +00:00
func ( x * resourceServiceWatchListServer ) Send ( m * WatchEvent ) error {
2023-03-09 19:40:23 +00:00
return x . ServerStream . SendMsg ( m )
}
// 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 : "hashicorp.consul.resource.ResourceService" ,
HandlerType : ( * ResourceServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Read" ,
Handler : _ResourceService_Read_Handler ,
} ,
{
MethodName : "Write" ,
Handler : _ResourceService_Write_Handler ,
} ,
{
MethodName : "WriteStatus" ,
Handler : _ResourceService_WriteStatus_Handler ,
} ,
{
MethodName : "List" ,
Handler : _ResourceService_List_Handler ,
} ,
{
MethodName : "Delete" ,
Handler : _ResourceService_Delete_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc {
{
2023-03-27 19:37:54 +00:00
StreamName : "WatchList" ,
Handler : _ResourceService_WatchList_Handler ,
2023-03-09 19:40:23 +00:00
ServerStreams : true ,
} ,
} ,
Metadata : "pbresource/resource.proto" ,
}