mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 02:16:28 +02:00
* core/proto: update protoc dependencies * cleanup * disable unimplemented forward compatibility check * fix mock * add generate make command * add .0
425 lines
15 KiB
Go
425 lines
15 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc v3.21.7
|
|
// source: api.proto
|
|
|
|
package cli
|
|
|
|
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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
Config_List_FullMethodName = "/pomerium.cli.Config/List"
|
|
Config_Delete_FullMethodName = "/pomerium.cli.Config/Delete"
|
|
Config_Upsert_FullMethodName = "/pomerium.cli.Config/Upsert"
|
|
Config_Export_FullMethodName = "/pomerium.cli.Config/Export"
|
|
Config_Import_FullMethodName = "/pomerium.cli.Config/Import"
|
|
)
|
|
|
|
// ConfigClient is the client API for Config 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 ConfigClient interface {
|
|
List(ctx context.Context, in *Selector, opts ...grpc.CallOption) (*ListRecordsResponse, error)
|
|
Delete(ctx context.Context, in *Selector, opts ...grpc.CallOption) (*DeleteRecordsResponse, error)
|
|
Upsert(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Record, error)
|
|
Export(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ConfigData, error)
|
|
Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error)
|
|
}
|
|
|
|
type configClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewConfigClient(cc grpc.ClientConnInterface) ConfigClient {
|
|
return &configClient{cc}
|
|
}
|
|
|
|
func (c *configClient) List(ctx context.Context, in *Selector, opts ...grpc.CallOption) (*ListRecordsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListRecordsResponse)
|
|
err := c.cc.Invoke(ctx, Config_List_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *configClient) Delete(ctx context.Context, in *Selector, opts ...grpc.CallOption) (*DeleteRecordsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteRecordsResponse)
|
|
err := c.cc.Invoke(ctx, Config_Delete_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *configClient) Upsert(ctx context.Context, in *Record, opts ...grpc.CallOption) (*Record, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Record)
|
|
err := c.cc.Invoke(ctx, Config_Upsert_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *configClient) Export(ctx context.Context, in *ExportRequest, opts ...grpc.CallOption) (*ConfigData, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ConfigData)
|
|
err := c.cc.Invoke(ctx, Config_Export_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *configClient) Import(ctx context.Context, in *ImportRequest, opts ...grpc.CallOption) (*ImportResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ImportResponse)
|
|
err := c.cc.Invoke(ctx, Config_Import_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ConfigServer is the server API for Config service.
|
|
// All implementations should embed UnimplementedConfigServer
|
|
// for forward compatibility.
|
|
type ConfigServer interface {
|
|
List(context.Context, *Selector) (*ListRecordsResponse, error)
|
|
Delete(context.Context, *Selector) (*DeleteRecordsResponse, error)
|
|
Upsert(context.Context, *Record) (*Record, error)
|
|
Export(context.Context, *ExportRequest) (*ConfigData, error)
|
|
Import(context.Context, *ImportRequest) (*ImportResponse, error)
|
|
}
|
|
|
|
// UnimplementedConfigServer should be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedConfigServer struct{}
|
|
|
|
func (UnimplementedConfigServer) List(context.Context, *Selector) (*ListRecordsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) Delete(context.Context, *Selector) (*DeleteRecordsResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) Upsert(context.Context, *Record) (*Record, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Upsert not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) Export(context.Context, *ExportRequest) (*ConfigData, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Export not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) Import(context.Context, *ImportRequest) (*ImportResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Import not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeConfigServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ConfigServer will
|
|
// result in compilation errors.
|
|
type UnsafeConfigServer interface {
|
|
mustEmbedUnimplementedConfigServer()
|
|
}
|
|
|
|
func RegisterConfigServer(s grpc.ServiceRegistrar, srv ConfigServer) {
|
|
// If the following call pancis, it indicates UnimplementedConfigServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Config_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Config_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Selector)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_List_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).List(ctx, req.(*Selector))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Config_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Selector)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Delete_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Delete(ctx, req.(*Selector))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Config_Upsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Record)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Upsert(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Upsert_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Upsert(ctx, req.(*Record))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Config_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ExportRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Export(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Export_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Export(ctx, req.(*ExportRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Config_Import_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ImportRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Import(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Import_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Import(ctx, req.(*ImportRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Config_ServiceDesc is the grpc.ServiceDesc for Config service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Config_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pomerium.cli.Config",
|
|
HandlerType: (*ConfigServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "List",
|
|
Handler: _Config_List_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _Config_Delete_Handler,
|
|
},
|
|
{
|
|
MethodName: "Upsert",
|
|
Handler: _Config_Upsert_Handler,
|
|
},
|
|
{
|
|
MethodName: "Export",
|
|
Handler: _Config_Export_Handler,
|
|
},
|
|
{
|
|
MethodName: "Import",
|
|
Handler: _Config_Import_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api.proto",
|
|
}
|
|
|
|
const (
|
|
Listener_Update_FullMethodName = "/pomerium.cli.Listener/Update"
|
|
Listener_StatusUpdates_FullMethodName = "/pomerium.cli.Listener/StatusUpdates"
|
|
)
|
|
|
|
// ListenerClient is the client API for Listener 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.
|
|
//
|
|
// Listener service controls listeners
|
|
type ListenerClient interface {
|
|
// Listen starts connection listener
|
|
Update(ctx context.Context, in *ListenerUpdateRequest, opts ...grpc.CallOption) (*ListenerStatus, error)
|
|
// StatusUpdates opens a stream to listen to connection status updates
|
|
// a client has to subscribe and continuously
|
|
// listen to the broadcasted updates
|
|
StatusUpdates(ctx context.Context, in *Selector, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ConnectionStatusUpdates], error)
|
|
}
|
|
|
|
type listenerClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewListenerClient(cc grpc.ClientConnInterface) ListenerClient {
|
|
return &listenerClient{cc}
|
|
}
|
|
|
|
func (c *listenerClient) Update(ctx context.Context, in *ListenerUpdateRequest, opts ...grpc.CallOption) (*ListenerStatus, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListenerStatus)
|
|
err := c.cc.Invoke(ctx, Listener_Update_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *listenerClient) StatusUpdates(ctx context.Context, in *Selector, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ConnectionStatusUpdates], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &Listener_ServiceDesc.Streams[0], Listener_StatusUpdates_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[Selector, ConnectionStatusUpdates]{ClientStream: 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
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type Listener_StatusUpdatesClient = grpc.ServerStreamingClient[ConnectionStatusUpdates]
|
|
|
|
// ListenerServer is the server API for Listener service.
|
|
// All implementations should embed UnimplementedListenerServer
|
|
// for forward compatibility.
|
|
//
|
|
// Listener service controls listeners
|
|
type ListenerServer interface {
|
|
// Listen starts connection listener
|
|
Update(context.Context, *ListenerUpdateRequest) (*ListenerStatus, error)
|
|
// StatusUpdates opens a stream to listen to connection status updates
|
|
// a client has to subscribe and continuously
|
|
// listen to the broadcasted updates
|
|
StatusUpdates(*Selector, grpc.ServerStreamingServer[ConnectionStatusUpdates]) error
|
|
}
|
|
|
|
// UnimplementedListenerServer should be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedListenerServer struct{}
|
|
|
|
func (UnimplementedListenerServer) Update(context.Context, *ListenerUpdateRequest) (*ListenerStatus, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
|
}
|
|
func (UnimplementedListenerServer) StatusUpdates(*Selector, grpc.ServerStreamingServer[ConnectionStatusUpdates]) error {
|
|
return status.Errorf(codes.Unimplemented, "method StatusUpdates not implemented")
|
|
}
|
|
func (UnimplementedListenerServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeListenerServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ListenerServer will
|
|
// result in compilation errors.
|
|
type UnsafeListenerServer interface {
|
|
mustEmbedUnimplementedListenerServer()
|
|
}
|
|
|
|
func RegisterListenerServer(s grpc.ServiceRegistrar, srv ListenerServer) {
|
|
// If the following call pancis, it indicates UnimplementedListenerServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Listener_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Listener_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListenerUpdateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ListenerServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Listener_Update_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ListenerServer).Update(ctx, req.(*ListenerUpdateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Listener_StatusUpdates_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(Selector)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(ListenerServer).StatusUpdates(m, &grpc.GenericServerStream[Selector, ConnectionStatusUpdates]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type Listener_StatusUpdatesServer = grpc.ServerStreamingServer[ConnectionStatusUpdates]
|
|
|
|
// Listener_ServiceDesc is the grpc.ServiceDesc for Listener service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Listener_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pomerium.cli.Listener",
|
|
HandlerType: (*ListenerServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _Listener_Update_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "StatusUpdates",
|
|
Handler: _Listener_StatusUpdates_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api.proto",
|
|
}
|