mirror of
https://github.com/garethgeorge/backrest.git
synced 2025-12-14 09:35:41 +00:00
213 lines
6.6 KiB
Go
213 lines
6.6 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: v1/service.proto
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// 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 (
|
|
ResticUI_GetConfig_FullMethodName = "/v1.ResticUI/GetConfig"
|
|
ResticUI_SetConfig_FullMethodName = "/v1.ResticUI/SetConfig"
|
|
ResticUI_GetEvents_FullMethodName = "/v1.ResticUI/GetEvents"
|
|
)
|
|
|
|
// ResticUIClient is the client API for ResticUI 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 ResticUIClient interface {
|
|
GetConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Config, error)
|
|
SetConfig(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error)
|
|
GetEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ResticUI_GetEventsClient, error)
|
|
}
|
|
|
|
type resticUIClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewResticUIClient(cc grpc.ClientConnInterface) ResticUIClient {
|
|
return &resticUIClient{cc}
|
|
}
|
|
|
|
func (c *resticUIClient) GetConfig(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Config, error) {
|
|
out := new(Config)
|
|
err := c.cc.Invoke(ctx, ResticUI_GetConfig_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resticUIClient) SetConfig(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Config, error) {
|
|
out := new(Config)
|
|
err := c.cc.Invoke(ctx, ResticUI_SetConfig_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resticUIClient) GetEvents(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (ResticUI_GetEventsClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &ResticUI_ServiceDesc.Streams[0], ResticUI_GetEvents_FullMethodName, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &resticUIGetEventsClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type ResticUI_GetEventsClient interface {
|
|
Recv() (*Event, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type resticUIGetEventsClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *resticUIGetEventsClient) Recv() (*Event, error) {
|
|
m := new(Event)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// ResticUIServer is the server API for ResticUI service.
|
|
// All implementations must embed UnimplementedResticUIServer
|
|
// for forward compatibility
|
|
type ResticUIServer interface {
|
|
GetConfig(context.Context, *emptypb.Empty) (*Config, error)
|
|
SetConfig(context.Context, *Config) (*Config, error)
|
|
GetEvents(*emptypb.Empty, ResticUI_GetEventsServer) error
|
|
mustEmbedUnimplementedResticUIServer()
|
|
}
|
|
|
|
// UnimplementedResticUIServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedResticUIServer struct {
|
|
}
|
|
|
|
func (UnimplementedResticUIServer) GetConfig(context.Context, *emptypb.Empty) (*Config, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented")
|
|
}
|
|
func (UnimplementedResticUIServer) SetConfig(context.Context, *Config) (*Config, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SetConfig not implemented")
|
|
}
|
|
func (UnimplementedResticUIServer) GetEvents(*emptypb.Empty, ResticUI_GetEventsServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method GetEvents not implemented")
|
|
}
|
|
func (UnimplementedResticUIServer) mustEmbedUnimplementedResticUIServer() {}
|
|
|
|
// UnsafeResticUIServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ResticUIServer will
|
|
// result in compilation errors.
|
|
type UnsafeResticUIServer interface {
|
|
mustEmbedUnimplementedResticUIServer()
|
|
}
|
|
|
|
func RegisterResticUIServer(s grpc.ServiceRegistrar, srv ResticUIServer) {
|
|
s.RegisterService(&ResticUI_ServiceDesc, srv)
|
|
}
|
|
|
|
func _ResticUI_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResticUIServer).GetConfig(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ResticUI_GetConfig_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResticUIServer).GetConfig(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResticUI_SetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Config)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResticUIServer).SetConfig(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: ResticUI_SetConfig_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResticUIServer).SetConfig(ctx, req.(*Config))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResticUI_GetEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(emptypb.Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ResticUIServer).GetEvents(m, &resticUIGetEventsServer{stream})
|
|
}
|
|
|
|
type ResticUI_GetEventsServer interface {
|
|
Send(*Event) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type resticUIGetEventsServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *resticUIGetEventsServer) Send(m *Event) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
// ResticUI_ServiceDesc is the grpc.ServiceDesc for ResticUI service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var ResticUI_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "v1.ResticUI",
|
|
HandlerType: (*ResticUIServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetConfig",
|
|
Handler: _ResticUI_GetConfig_Handler,
|
|
},
|
|
{
|
|
MethodName: "SetConfig",
|
|
Handler: _ResticUI_SetConfig_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "GetEvents",
|
|
Handler: _ResticUI_GetEvents_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "v1/service.proto",
|
|
}
|