service_grpc.pb.go raw

   1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
   2  // versions:
   3  // - protoc-gen-go-grpc v1.6.0
   4  // - protoc             (unknown)
   5  // source: orlysync/relaygroup/v1/service.proto
   6  
   7  package relaygroupv1
   8  
   9  import (
  10  	context "context"
  11  	grpc "google.golang.org/grpc"
  12  	codes "google.golang.org/grpc/codes"
  13  	status "google.golang.org/grpc/status"
  14  	v1 "next.orly.dev/pkg/proto/orlysync/common/v1"
  15  )
  16  
  17  // This is a compile-time assertion to ensure that this generated file
  18  // is compatible with the grpc package it is being compiled against.
  19  // Requires gRPC-Go v1.64.0 or later.
  20  const _ = grpc.SupportPackageIsVersion9
  21  
  22  const (
  23  	RelayGroupService_Ready_FullMethodName                   = "/orlysync.relaygroup.v1.RelayGroupService/Ready"
  24  	RelayGroupService_FindAuthoritativeConfig_FullMethodName = "/orlysync.relaygroup.v1.RelayGroupService/FindAuthoritativeConfig"
  25  	RelayGroupService_GetRelays_FullMethodName               = "/orlysync.relaygroup.v1.RelayGroupService/GetRelays"
  26  	RelayGroupService_IsAuthorizedPublisher_FullMethodName   = "/orlysync.relaygroup.v1.RelayGroupService/IsAuthorizedPublisher"
  27  	RelayGroupService_GetAuthorizedPubkeys_FullMethodName    = "/orlysync.relaygroup.v1.RelayGroupService/GetAuthorizedPubkeys"
  28  	RelayGroupService_ValidateRelayGroupEvent_FullMethodName = "/orlysync.relaygroup.v1.RelayGroupService/ValidateRelayGroupEvent"
  29  	RelayGroupService_HandleRelayGroupEvent_FullMethodName   = "/orlysync.relaygroup.v1.RelayGroupService/HandleRelayGroupEvent"
  30  )
  31  
  32  // RelayGroupServiceClient is the client API for RelayGroupService service.
  33  //
  34  // 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.
  35  //
  36  // RelayGroupService provides relay group configuration discovery
  37  // by selecting authoritative config from Kind 39105 events
  38  type RelayGroupServiceClient interface {
  39  	// Ready returns whether the service is ready to serve requests
  40  	Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error)
  41  	// FindAuthoritativeConfig finds the authoritative relay group configuration
  42  	// using timestamp ordering with hash tie-breaking
  43  	FindAuthoritativeConfig(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*RelayGroupConfigResponse, error)
  44  	// GetRelays returns the list of relays from the authoritative config
  45  	GetRelays(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*RelaysResponse, error)
  46  	// IsAuthorizedPublisher checks if a pubkey can publish relay group configs
  47  	IsAuthorizedPublisher(ctx context.Context, in *AuthorizedPublisherRequest, opts ...grpc.CallOption) (*AuthorizedPublisherResponse, error)
  48  	// GetAuthorizedPubkeys returns all authorized publisher pubkeys
  49  	GetAuthorizedPubkeys(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*AuthorizedPubkeysResponse, error)
  50  	// ValidateRelayGroupEvent validates a relay group configuration event
  51  	ValidateRelayGroupEvent(ctx context.Context, in *ValidateEventRequest, opts ...grpc.CallOption) (*ValidateEventResponse, error)
  52  	// HandleRelayGroupEvent processes a relay group event and triggers peer updates
  53  	HandleRelayGroupEvent(ctx context.Context, in *HandleEventRequest, opts ...grpc.CallOption) (*v1.Empty, error)
  54  }
  55  
  56  type relayGroupServiceClient struct {
  57  	cc grpc.ClientConnInterface
  58  }
  59  
  60  func NewRelayGroupServiceClient(cc grpc.ClientConnInterface) RelayGroupServiceClient {
  61  	return &relayGroupServiceClient{cc}
  62  }
  63  
  64  func (c *relayGroupServiceClient) Ready(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.ReadyResponse, error) {
  65  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  66  	out := new(v1.ReadyResponse)
  67  	err := c.cc.Invoke(ctx, RelayGroupService_Ready_FullMethodName, in, out, cOpts...)
  68  	if err != nil {
  69  		return nil, err
  70  	}
  71  	return out, nil
  72  }
  73  
  74  func (c *relayGroupServiceClient) FindAuthoritativeConfig(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*RelayGroupConfigResponse, error) {
  75  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  76  	out := new(RelayGroupConfigResponse)
  77  	err := c.cc.Invoke(ctx, RelayGroupService_FindAuthoritativeConfig_FullMethodName, in, out, cOpts...)
  78  	if err != nil {
  79  		return nil, err
  80  	}
  81  	return out, nil
  82  }
  83  
  84  func (c *relayGroupServiceClient) GetRelays(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*RelaysResponse, error) {
  85  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  86  	out := new(RelaysResponse)
  87  	err := c.cc.Invoke(ctx, RelayGroupService_GetRelays_FullMethodName, in, out, cOpts...)
  88  	if err != nil {
  89  		return nil, err
  90  	}
  91  	return out, nil
  92  }
  93  
  94  func (c *relayGroupServiceClient) IsAuthorizedPublisher(ctx context.Context, in *AuthorizedPublisherRequest, opts ...grpc.CallOption) (*AuthorizedPublisherResponse, error) {
  95  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  96  	out := new(AuthorizedPublisherResponse)
  97  	err := c.cc.Invoke(ctx, RelayGroupService_IsAuthorizedPublisher_FullMethodName, in, out, cOpts...)
  98  	if err != nil {
  99  		return nil, err
 100  	}
 101  	return out, nil
 102  }
 103  
 104  func (c *relayGroupServiceClient) GetAuthorizedPubkeys(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*AuthorizedPubkeysResponse, error) {
 105  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 106  	out := new(AuthorizedPubkeysResponse)
 107  	err := c.cc.Invoke(ctx, RelayGroupService_GetAuthorizedPubkeys_FullMethodName, in, out, cOpts...)
 108  	if err != nil {
 109  		return nil, err
 110  	}
 111  	return out, nil
 112  }
 113  
 114  func (c *relayGroupServiceClient) ValidateRelayGroupEvent(ctx context.Context, in *ValidateEventRequest, opts ...grpc.CallOption) (*ValidateEventResponse, error) {
 115  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 116  	out := new(ValidateEventResponse)
 117  	err := c.cc.Invoke(ctx, RelayGroupService_ValidateRelayGroupEvent_FullMethodName, in, out, cOpts...)
 118  	if err != nil {
 119  		return nil, err
 120  	}
 121  	return out, nil
 122  }
 123  
 124  func (c *relayGroupServiceClient) HandleRelayGroupEvent(ctx context.Context, in *HandleEventRequest, opts ...grpc.CallOption) (*v1.Empty, error) {
 125  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 126  	out := new(v1.Empty)
 127  	err := c.cc.Invoke(ctx, RelayGroupService_HandleRelayGroupEvent_FullMethodName, in, out, cOpts...)
 128  	if err != nil {
 129  		return nil, err
 130  	}
 131  	return out, nil
 132  }
 133  
 134  // RelayGroupServiceServer is the server API for RelayGroupService service.
 135  // All implementations must embed UnimplementedRelayGroupServiceServer
 136  // for forward compatibility.
 137  //
 138  // RelayGroupService provides relay group configuration discovery
 139  // by selecting authoritative config from Kind 39105 events
 140  type RelayGroupServiceServer interface {
 141  	// Ready returns whether the service is ready to serve requests
 142  	Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error)
 143  	// FindAuthoritativeConfig finds the authoritative relay group configuration
 144  	// using timestamp ordering with hash tie-breaking
 145  	FindAuthoritativeConfig(context.Context, *v1.Empty) (*RelayGroupConfigResponse, error)
 146  	// GetRelays returns the list of relays from the authoritative config
 147  	GetRelays(context.Context, *v1.Empty) (*RelaysResponse, error)
 148  	// IsAuthorizedPublisher checks if a pubkey can publish relay group configs
 149  	IsAuthorizedPublisher(context.Context, *AuthorizedPublisherRequest) (*AuthorizedPublisherResponse, error)
 150  	// GetAuthorizedPubkeys returns all authorized publisher pubkeys
 151  	GetAuthorizedPubkeys(context.Context, *v1.Empty) (*AuthorizedPubkeysResponse, error)
 152  	// ValidateRelayGroupEvent validates a relay group configuration event
 153  	ValidateRelayGroupEvent(context.Context, *ValidateEventRequest) (*ValidateEventResponse, error)
 154  	// HandleRelayGroupEvent processes a relay group event and triggers peer updates
 155  	HandleRelayGroupEvent(context.Context, *HandleEventRequest) (*v1.Empty, error)
 156  	mustEmbedUnimplementedRelayGroupServiceServer()
 157  }
 158  
 159  // UnimplementedRelayGroupServiceServer must be embedded to have
 160  // forward compatible implementations.
 161  //
 162  // NOTE: this should be embedded by value instead of pointer to avoid a nil
 163  // pointer dereference when methods are called.
 164  type UnimplementedRelayGroupServiceServer struct{}
 165  
 166  func (UnimplementedRelayGroupServiceServer) Ready(context.Context, *v1.Empty) (*v1.ReadyResponse, error) {
 167  	return nil, status.Error(codes.Unimplemented, "method Ready not implemented")
 168  }
 169  func (UnimplementedRelayGroupServiceServer) FindAuthoritativeConfig(context.Context, *v1.Empty) (*RelayGroupConfigResponse, error) {
 170  	return nil, status.Error(codes.Unimplemented, "method FindAuthoritativeConfig not implemented")
 171  }
 172  func (UnimplementedRelayGroupServiceServer) GetRelays(context.Context, *v1.Empty) (*RelaysResponse, error) {
 173  	return nil, status.Error(codes.Unimplemented, "method GetRelays not implemented")
 174  }
 175  func (UnimplementedRelayGroupServiceServer) IsAuthorizedPublisher(context.Context, *AuthorizedPublisherRequest) (*AuthorizedPublisherResponse, error) {
 176  	return nil, status.Error(codes.Unimplemented, "method IsAuthorizedPublisher not implemented")
 177  }
 178  func (UnimplementedRelayGroupServiceServer) GetAuthorizedPubkeys(context.Context, *v1.Empty) (*AuthorizedPubkeysResponse, error) {
 179  	return nil, status.Error(codes.Unimplemented, "method GetAuthorizedPubkeys not implemented")
 180  }
 181  func (UnimplementedRelayGroupServiceServer) ValidateRelayGroupEvent(context.Context, *ValidateEventRequest) (*ValidateEventResponse, error) {
 182  	return nil, status.Error(codes.Unimplemented, "method ValidateRelayGroupEvent not implemented")
 183  }
 184  func (UnimplementedRelayGroupServiceServer) HandleRelayGroupEvent(context.Context, *HandleEventRequest) (*v1.Empty, error) {
 185  	return nil, status.Error(codes.Unimplemented, "method HandleRelayGroupEvent not implemented")
 186  }
 187  func (UnimplementedRelayGroupServiceServer) mustEmbedUnimplementedRelayGroupServiceServer() {}
 188  func (UnimplementedRelayGroupServiceServer) testEmbeddedByValue()                           {}
 189  
 190  // UnsafeRelayGroupServiceServer may be embedded to opt out of forward compatibility for this service.
 191  // Use of this interface is not recommended, as added methods to RelayGroupServiceServer will
 192  // result in compilation errors.
 193  type UnsafeRelayGroupServiceServer interface {
 194  	mustEmbedUnimplementedRelayGroupServiceServer()
 195  }
 196  
 197  func RegisterRelayGroupServiceServer(s grpc.ServiceRegistrar, srv RelayGroupServiceServer) {
 198  	// If the following call panics, it indicates UnimplementedRelayGroupServiceServer was
 199  	// embedded by pointer and is nil.  This will cause panics if an
 200  	// unimplemented method is ever invoked, so we test this at initialization
 201  	// time to prevent it from happening at runtime later due to I/O.
 202  	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
 203  		t.testEmbeddedByValue()
 204  	}
 205  	s.RegisterService(&RelayGroupService_ServiceDesc, srv)
 206  }
 207  
 208  func _RelayGroupService_Ready_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 209  	in := new(v1.Empty)
 210  	if err := dec(in); err != nil {
 211  		return nil, err
 212  	}
 213  	if interceptor == nil {
 214  		return srv.(RelayGroupServiceServer).Ready(ctx, in)
 215  	}
 216  	info := &grpc.UnaryServerInfo{
 217  		Server:     srv,
 218  		FullMethod: RelayGroupService_Ready_FullMethodName,
 219  	}
 220  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 221  		return srv.(RelayGroupServiceServer).Ready(ctx, req.(*v1.Empty))
 222  	}
 223  	return interceptor(ctx, in, info, handler)
 224  }
 225  
 226  func _RelayGroupService_FindAuthoritativeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 227  	in := new(v1.Empty)
 228  	if err := dec(in); err != nil {
 229  		return nil, err
 230  	}
 231  	if interceptor == nil {
 232  		return srv.(RelayGroupServiceServer).FindAuthoritativeConfig(ctx, in)
 233  	}
 234  	info := &grpc.UnaryServerInfo{
 235  		Server:     srv,
 236  		FullMethod: RelayGroupService_FindAuthoritativeConfig_FullMethodName,
 237  	}
 238  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 239  		return srv.(RelayGroupServiceServer).FindAuthoritativeConfig(ctx, req.(*v1.Empty))
 240  	}
 241  	return interceptor(ctx, in, info, handler)
 242  }
 243  
 244  func _RelayGroupService_GetRelays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 245  	in := new(v1.Empty)
 246  	if err := dec(in); err != nil {
 247  		return nil, err
 248  	}
 249  	if interceptor == nil {
 250  		return srv.(RelayGroupServiceServer).GetRelays(ctx, in)
 251  	}
 252  	info := &grpc.UnaryServerInfo{
 253  		Server:     srv,
 254  		FullMethod: RelayGroupService_GetRelays_FullMethodName,
 255  	}
 256  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 257  		return srv.(RelayGroupServiceServer).GetRelays(ctx, req.(*v1.Empty))
 258  	}
 259  	return interceptor(ctx, in, info, handler)
 260  }
 261  
 262  func _RelayGroupService_IsAuthorizedPublisher_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 263  	in := new(AuthorizedPublisherRequest)
 264  	if err := dec(in); err != nil {
 265  		return nil, err
 266  	}
 267  	if interceptor == nil {
 268  		return srv.(RelayGroupServiceServer).IsAuthorizedPublisher(ctx, in)
 269  	}
 270  	info := &grpc.UnaryServerInfo{
 271  		Server:     srv,
 272  		FullMethod: RelayGroupService_IsAuthorizedPublisher_FullMethodName,
 273  	}
 274  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 275  		return srv.(RelayGroupServiceServer).IsAuthorizedPublisher(ctx, req.(*AuthorizedPublisherRequest))
 276  	}
 277  	return interceptor(ctx, in, info, handler)
 278  }
 279  
 280  func _RelayGroupService_GetAuthorizedPubkeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 281  	in := new(v1.Empty)
 282  	if err := dec(in); err != nil {
 283  		return nil, err
 284  	}
 285  	if interceptor == nil {
 286  		return srv.(RelayGroupServiceServer).GetAuthorizedPubkeys(ctx, in)
 287  	}
 288  	info := &grpc.UnaryServerInfo{
 289  		Server:     srv,
 290  		FullMethod: RelayGroupService_GetAuthorizedPubkeys_FullMethodName,
 291  	}
 292  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 293  		return srv.(RelayGroupServiceServer).GetAuthorizedPubkeys(ctx, req.(*v1.Empty))
 294  	}
 295  	return interceptor(ctx, in, info, handler)
 296  }
 297  
 298  func _RelayGroupService_ValidateRelayGroupEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 299  	in := new(ValidateEventRequest)
 300  	if err := dec(in); err != nil {
 301  		return nil, err
 302  	}
 303  	if interceptor == nil {
 304  		return srv.(RelayGroupServiceServer).ValidateRelayGroupEvent(ctx, in)
 305  	}
 306  	info := &grpc.UnaryServerInfo{
 307  		Server:     srv,
 308  		FullMethod: RelayGroupService_ValidateRelayGroupEvent_FullMethodName,
 309  	}
 310  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 311  		return srv.(RelayGroupServiceServer).ValidateRelayGroupEvent(ctx, req.(*ValidateEventRequest))
 312  	}
 313  	return interceptor(ctx, in, info, handler)
 314  }
 315  
 316  func _RelayGroupService_HandleRelayGroupEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 317  	in := new(HandleEventRequest)
 318  	if err := dec(in); err != nil {
 319  		return nil, err
 320  	}
 321  	if interceptor == nil {
 322  		return srv.(RelayGroupServiceServer).HandleRelayGroupEvent(ctx, in)
 323  	}
 324  	info := &grpc.UnaryServerInfo{
 325  		Server:     srv,
 326  		FullMethod: RelayGroupService_HandleRelayGroupEvent_FullMethodName,
 327  	}
 328  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 329  		return srv.(RelayGroupServiceServer).HandleRelayGroupEvent(ctx, req.(*HandleEventRequest))
 330  	}
 331  	return interceptor(ctx, in, info, handler)
 332  }
 333  
 334  // RelayGroupService_ServiceDesc is the grpc.ServiceDesc for RelayGroupService service.
 335  // It's only intended for direct use with grpc.RegisterService,
 336  // and not to be introspected or modified (even as a copy)
 337  var RelayGroupService_ServiceDesc = grpc.ServiceDesc{
 338  	ServiceName: "orlysync.relaygroup.v1.RelayGroupService",
 339  	HandlerType: (*RelayGroupServiceServer)(nil),
 340  	Methods: []grpc.MethodDesc{
 341  		{
 342  			MethodName: "Ready",
 343  			Handler:    _RelayGroupService_Ready_Handler,
 344  		},
 345  		{
 346  			MethodName: "FindAuthoritativeConfig",
 347  			Handler:    _RelayGroupService_FindAuthoritativeConfig_Handler,
 348  		},
 349  		{
 350  			MethodName: "GetRelays",
 351  			Handler:    _RelayGroupService_GetRelays_Handler,
 352  		},
 353  		{
 354  			MethodName: "IsAuthorizedPublisher",
 355  			Handler:    _RelayGroupService_IsAuthorizedPublisher_Handler,
 356  		},
 357  		{
 358  			MethodName: "GetAuthorizedPubkeys",
 359  			Handler:    _RelayGroupService_GetAuthorizedPubkeys_Handler,
 360  		},
 361  		{
 362  			MethodName: "ValidateRelayGroupEvent",
 363  			Handler:    _RelayGroupService_ValidateRelayGroupEvent_Handler,
 364  		},
 365  		{
 366  			MethodName: "HandleRelayGroupEvent",
 367  			Handler:    _RelayGroupService_HandleRelayGroupEvent_Handler,
 368  		},
 369  	},
 370  	Streams:  []grpc.StreamDesc{},
 371  	Metadata: "orlysync/relaygroup/v1/service.proto",
 372  }
 373