github.com/crowdsecurity/crowdsec@v1.6.1/pkg/protobufs/notifier.pb.go (about)

     1  // Code generated by protoc-gen-go. DO NOT EDIT.
     2  // versions:
     3  // 	protoc-gen-go v1.27.1
     4  // 	protoc        v3.12.4
     5  // source: notifier.proto
     6  
     7  package protobufs
     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  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
    15  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
    16  	reflect "reflect"
    17  	sync "sync"
    18  )
    19  
    20  const (
    21  	// Verify that this generated code is sufficiently up-to-date.
    22  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    23  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    24  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    25  )
    26  
    27  type Notification struct {
    28  	state         protoimpl.MessageState
    29  	sizeCache     protoimpl.SizeCache
    30  	unknownFields protoimpl.UnknownFields
    31  
    32  	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
    33  	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
    34  }
    35  
    36  func (x *Notification) Reset() {
    37  	*x = Notification{}
    38  	if protoimpl.UnsafeEnabled {
    39  		mi := &file_notifier_proto_msgTypes[0]
    40  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    41  		ms.StoreMessageInfo(mi)
    42  	}
    43  }
    44  
    45  func (x *Notification) String() string {
    46  	return protoimpl.X.MessageStringOf(x)
    47  }
    48  
    49  func (*Notification) ProtoMessage() {}
    50  
    51  func (x *Notification) ProtoReflect() protoreflect.Message {
    52  	mi := &file_notifier_proto_msgTypes[0]
    53  	if protoimpl.UnsafeEnabled && x != nil {
    54  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    55  		if ms.LoadMessageInfo() == nil {
    56  			ms.StoreMessageInfo(mi)
    57  		}
    58  		return ms
    59  	}
    60  	return mi.MessageOf(x)
    61  }
    62  
    63  // Deprecated: Use Notification.ProtoReflect.Descriptor instead.
    64  func (*Notification) Descriptor() ([]byte, []int) {
    65  	return file_notifier_proto_rawDescGZIP(), []int{0}
    66  }
    67  
    68  func (x *Notification) GetText() string {
    69  	if x != nil {
    70  		return x.Text
    71  	}
    72  	return ""
    73  }
    74  
    75  func (x *Notification) GetName() string {
    76  	if x != nil {
    77  		return x.Name
    78  	}
    79  	return ""
    80  }
    81  
    82  type Config struct {
    83  	state         protoimpl.MessageState
    84  	sizeCache     protoimpl.SizeCache
    85  	unknownFields protoimpl.UnknownFields
    86  
    87  	Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
    88  }
    89  
    90  func (x *Config) Reset() {
    91  	*x = Config{}
    92  	if protoimpl.UnsafeEnabled {
    93  		mi := &file_notifier_proto_msgTypes[1]
    94  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
    95  		ms.StoreMessageInfo(mi)
    96  	}
    97  }
    98  
    99  func (x *Config) String() string {
   100  	return protoimpl.X.MessageStringOf(x)
   101  }
   102  
   103  func (*Config) ProtoMessage() {}
   104  
   105  func (x *Config) ProtoReflect() protoreflect.Message {
   106  	mi := &file_notifier_proto_msgTypes[1]
   107  	if protoimpl.UnsafeEnabled && x != nil {
   108  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   109  		if ms.LoadMessageInfo() == nil {
   110  			ms.StoreMessageInfo(mi)
   111  		}
   112  		return ms
   113  	}
   114  	return mi.MessageOf(x)
   115  }
   116  
   117  // Deprecated: Use Config.ProtoReflect.Descriptor instead.
   118  func (*Config) Descriptor() ([]byte, []int) {
   119  	return file_notifier_proto_rawDescGZIP(), []int{1}
   120  }
   121  
   122  func (x *Config) GetConfig() []byte {
   123  	if x != nil {
   124  		return x.Config
   125  	}
   126  	return nil
   127  }
   128  
   129  type Empty struct {
   130  	state         protoimpl.MessageState
   131  	sizeCache     protoimpl.SizeCache
   132  	unknownFields protoimpl.UnknownFields
   133  }
   134  
   135  func (x *Empty) Reset() {
   136  	*x = Empty{}
   137  	if protoimpl.UnsafeEnabled {
   138  		mi := &file_notifier_proto_msgTypes[2]
   139  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   140  		ms.StoreMessageInfo(mi)
   141  	}
   142  }
   143  
   144  func (x *Empty) String() string {
   145  	return protoimpl.X.MessageStringOf(x)
   146  }
   147  
   148  func (*Empty) ProtoMessage() {}
   149  
   150  func (x *Empty) ProtoReflect() protoreflect.Message {
   151  	mi := &file_notifier_proto_msgTypes[2]
   152  	if protoimpl.UnsafeEnabled && x != nil {
   153  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
   154  		if ms.LoadMessageInfo() == nil {
   155  			ms.StoreMessageInfo(mi)
   156  		}
   157  		return ms
   158  	}
   159  	return mi.MessageOf(x)
   160  }
   161  
   162  // Deprecated: Use Empty.ProtoReflect.Descriptor instead.
   163  func (*Empty) Descriptor() ([]byte, []int) {
   164  	return file_notifier_proto_rawDescGZIP(), []int{2}
   165  }
   166  
   167  var File_notifier_proto protoreflect.FileDescriptor
   168  
   169  var file_notifier_proto_rawDesc = []byte{
   170  	0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
   171  	0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x69, 0x66,
   172  	0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18,
   173  	0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
   174  	0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
   175  	0x20, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e,
   176  	0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69,
   177  	0x67, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x61, 0x0a, 0x08, 0x4e, 0x6f,
   178  	0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79,
   179  	0x12, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63,
   180  	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d,
   181  	0x70, 0x74, 0x79, 0x12, 0x28, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65,
   182  	0x12, 0x0d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a,
   183  	0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x0d, 0x5a,
   184  	0x0b, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x73, 0x62, 0x06, 0x70, 0x72,
   185  	0x6f, 0x74, 0x6f, 0x33,
   186  }
   187  
   188  var (
   189  	file_notifier_proto_rawDescOnce sync.Once
   190  	file_notifier_proto_rawDescData = file_notifier_proto_rawDesc
   191  )
   192  
   193  func file_notifier_proto_rawDescGZIP() []byte {
   194  	file_notifier_proto_rawDescOnce.Do(func() {
   195  		file_notifier_proto_rawDescData = protoimpl.X.CompressGZIP(file_notifier_proto_rawDescData)
   196  	})
   197  	return file_notifier_proto_rawDescData
   198  }
   199  
   200  var file_notifier_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
   201  var file_notifier_proto_goTypes = []interface{}{
   202  	(*Notification)(nil), // 0: proto.Notification
   203  	(*Config)(nil),       // 1: proto.Config
   204  	(*Empty)(nil),        // 2: proto.Empty
   205  }
   206  var file_notifier_proto_depIdxs = []int32{
   207  	0, // 0: proto.Notifier.Notify:input_type -> proto.Notification
   208  	1, // 1: proto.Notifier.Configure:input_type -> proto.Config
   209  	2, // 2: proto.Notifier.Notify:output_type -> proto.Empty
   210  	2, // 3: proto.Notifier.Configure:output_type -> proto.Empty
   211  	2, // [2:4] is the sub-list for method output_type
   212  	0, // [0:2] is the sub-list for method input_type
   213  	0, // [0:0] is the sub-list for extension type_name
   214  	0, // [0:0] is the sub-list for extension extendee
   215  	0, // [0:0] is the sub-list for field type_name
   216  }
   217  
   218  func init() { file_notifier_proto_init() }
   219  func file_notifier_proto_init() {
   220  	if File_notifier_proto != nil {
   221  		return
   222  	}
   223  	if !protoimpl.UnsafeEnabled {
   224  		file_notifier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
   225  			switch v := v.(*Notification); i {
   226  			case 0:
   227  				return &v.state
   228  			case 1:
   229  				return &v.sizeCache
   230  			case 2:
   231  				return &v.unknownFields
   232  			default:
   233  				return nil
   234  			}
   235  		}
   236  		file_notifier_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
   237  			switch v := v.(*Config); i {
   238  			case 0:
   239  				return &v.state
   240  			case 1:
   241  				return &v.sizeCache
   242  			case 2:
   243  				return &v.unknownFields
   244  			default:
   245  				return nil
   246  			}
   247  		}
   248  		file_notifier_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
   249  			switch v := v.(*Empty); i {
   250  			case 0:
   251  				return &v.state
   252  			case 1:
   253  				return &v.sizeCache
   254  			case 2:
   255  				return &v.unknownFields
   256  			default:
   257  				return nil
   258  			}
   259  		}
   260  	}
   261  	type x struct{}
   262  	out := protoimpl.TypeBuilder{
   263  		File: protoimpl.DescBuilder{
   264  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
   265  			RawDescriptor: file_notifier_proto_rawDesc,
   266  			NumEnums:      0,
   267  			NumMessages:   3,
   268  			NumExtensions: 0,
   269  			NumServices:   1,
   270  		},
   271  		GoTypes:           file_notifier_proto_goTypes,
   272  		DependencyIndexes: file_notifier_proto_depIdxs,
   273  		MessageInfos:      file_notifier_proto_msgTypes,
   274  	}.Build()
   275  	File_notifier_proto = out.File
   276  	file_notifier_proto_rawDesc = nil
   277  	file_notifier_proto_goTypes = nil
   278  	file_notifier_proto_depIdxs = nil
   279  }
   280  
   281  // Reference imports to suppress errors if they are not otherwise used.
   282  var _ context.Context
   283  var _ grpc.ClientConnInterface
   284  
   285  // This is a compile-time assertion to ensure that this generated file
   286  // is compatible with the grpc package it is being compiled against.
   287  const _ = grpc.SupportPackageIsVersion6
   288  
   289  // NotifierClient is the client API for Notifier service.
   290  //
   291  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   292  type NotifierClient interface {
   293  	Notify(ctx context.Context, in *Notification, opts ...grpc.CallOption) (*Empty, error)
   294  	Configure(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Empty, error)
   295  }
   296  
   297  type notifierClient struct {
   298  	cc grpc.ClientConnInterface
   299  }
   300  
   301  func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient {
   302  	return &notifierClient{cc}
   303  }
   304  
   305  func (c *notifierClient) Notify(ctx context.Context, in *Notification, opts ...grpc.CallOption) (*Empty, error) {
   306  	out := new(Empty)
   307  	err := c.cc.Invoke(ctx, "/proto.Notifier/Notify", in, out, opts...)
   308  	if err != nil {
   309  		return nil, err
   310  	}
   311  	return out, nil
   312  }
   313  
   314  func (c *notifierClient) Configure(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Empty, error) {
   315  	out := new(Empty)
   316  	err := c.cc.Invoke(ctx, "/proto.Notifier/Configure", in, out, opts...)
   317  	if err != nil {
   318  		return nil, err
   319  	}
   320  	return out, nil
   321  }
   322  
   323  // NotifierServer is the server API for Notifier service.
   324  type NotifierServer interface {
   325  	Notify(context.Context, *Notification) (*Empty, error)
   326  	Configure(context.Context, *Config) (*Empty, error)
   327  }
   328  
   329  // UnimplementedNotifierServer can be embedded to have forward compatible implementations.
   330  type UnimplementedNotifierServer struct {
   331  }
   332  
   333  func (*UnimplementedNotifierServer) Notify(context.Context, *Notification) (*Empty, error) {
   334  	return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")
   335  }
   336  func (*UnimplementedNotifierServer) Configure(context.Context, *Config) (*Empty, error) {
   337  	return nil, status.Errorf(codes.Unimplemented, "method Configure not implemented")
   338  }
   339  
   340  func RegisterNotifierServer(s *grpc.Server, srv NotifierServer) {
   341  	s.RegisterService(&_Notifier_serviceDesc, srv)
   342  }
   343  
   344  func _Notifier_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   345  	in := new(Notification)
   346  	if err := dec(in); err != nil {
   347  		return nil, err
   348  	}
   349  	if interceptor == nil {
   350  		return srv.(NotifierServer).Notify(ctx, in)
   351  	}
   352  	info := &grpc.UnaryServerInfo{
   353  		Server:     srv,
   354  		FullMethod: "/proto.Notifier/Notify",
   355  	}
   356  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   357  		return srv.(NotifierServer).Notify(ctx, req.(*Notification))
   358  	}
   359  	return interceptor(ctx, in, info, handler)
   360  }
   361  
   362  func _Notifier_Configure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   363  	in := new(Config)
   364  	if err := dec(in); err != nil {
   365  		return nil, err
   366  	}
   367  	if interceptor == nil {
   368  		return srv.(NotifierServer).Configure(ctx, in)
   369  	}
   370  	info := &grpc.UnaryServerInfo{
   371  		Server:     srv,
   372  		FullMethod: "/proto.Notifier/Configure",
   373  	}
   374  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   375  		return srv.(NotifierServer).Configure(ctx, req.(*Config))
   376  	}
   377  	return interceptor(ctx, in, info, handler)
   378  }
   379  
   380  var _Notifier_serviceDesc = grpc.ServiceDesc{
   381  	ServiceName: "proto.Notifier",
   382  	HandlerType: (*NotifierServer)(nil),
   383  	Methods: []grpc.MethodDesc{
   384  		{
   385  			MethodName: "Notify",
   386  			Handler:    _Notifier_Notify_Handler,
   387  		},
   388  		{
   389  			MethodName: "Configure",
   390  			Handler:    _Notifier_Configure_Handler,
   391  		},
   392  	},
   393  	Streams:  []grpc.StreamDesc{},
   394  	Metadata: "notifier.proto",
   395  }