mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 00:24:40 +01:00
feat: add protobuf generated files
If you want to use the UI module in another project, Go will not allow you to import the package because the ui protobuf package is missing. We have to commit it so that we can allow this project to be used as a library.
This commit is contained in:
parent
feaf8de508
commit
9acb70206f
2 changed files with 1702 additions and 0 deletions
1456
daemon/ui/protocol/ui.pb.go
Normal file
1456
daemon/ui/protocol/ui.pb.go
Normal file
File diff suppressed because it is too large
Load diff
246
daemon/ui/protocol/ui_grpc.pb.go
Normal file
246
daemon/ui/protocol/ui_grpc.pb.go
Normal file
|
@ -0,0 +1,246 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.19.4
|
||||
// source: ui.proto
|
||||
|
||||
package protocol
|
||||
|
||||
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
|
||||
|
||||
// UIClient is the client API for UI 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 UIClient interface {
|
||||
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error)
|
||||
AskRule(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*Rule, error)
|
||||
Subscribe(ctx context.Context, in *ClientConfig, opts ...grpc.CallOption) (*ClientConfig, error)
|
||||
Notifications(ctx context.Context, opts ...grpc.CallOption) (UI_NotificationsClient, error)
|
||||
}
|
||||
|
||||
type uIClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewUIClient(cc grpc.ClientConnInterface) UIClient {
|
||||
return &uIClient{cc}
|
||||
}
|
||||
|
||||
func (c *uIClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) {
|
||||
out := new(PingReply)
|
||||
err := c.cc.Invoke(ctx, "/protocol.UI/Ping", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *uIClient) AskRule(ctx context.Context, in *Connection, opts ...grpc.CallOption) (*Rule, error) {
|
||||
out := new(Rule)
|
||||
err := c.cc.Invoke(ctx, "/protocol.UI/AskRule", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *uIClient) Subscribe(ctx context.Context, in *ClientConfig, opts ...grpc.CallOption) (*ClientConfig, error) {
|
||||
out := new(ClientConfig)
|
||||
err := c.cc.Invoke(ctx, "/protocol.UI/Subscribe", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *uIClient) Notifications(ctx context.Context, opts ...grpc.CallOption) (UI_NotificationsClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &UI_ServiceDesc.Streams[0], "/protocol.UI/Notifications", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &uINotificationsClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type UI_NotificationsClient interface {
|
||||
Send(*NotificationReply) error
|
||||
Recv() (*Notification, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type uINotificationsClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *uINotificationsClient) Send(m *NotificationReply) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *uINotificationsClient) Recv() (*Notification, error) {
|
||||
m := new(Notification)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// UIServer is the server API for UI service.
|
||||
// All implementations must embed UnimplementedUIServer
|
||||
// for forward compatibility
|
||||
type UIServer interface {
|
||||
Ping(context.Context, *PingRequest) (*PingReply, error)
|
||||
AskRule(context.Context, *Connection) (*Rule, error)
|
||||
Subscribe(context.Context, *ClientConfig) (*ClientConfig, error)
|
||||
Notifications(UI_NotificationsServer) error
|
||||
mustEmbedUnimplementedUIServer()
|
||||
}
|
||||
|
||||
// UnimplementedUIServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedUIServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedUIServer) Ping(context.Context, *PingRequest) (*PingReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
|
||||
}
|
||||
func (UnimplementedUIServer) AskRule(context.Context, *Connection) (*Rule, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AskRule not implemented")
|
||||
}
|
||||
func (UnimplementedUIServer) Subscribe(context.Context, *ClientConfig) (*ClientConfig, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
|
||||
}
|
||||
func (UnimplementedUIServer) Notifications(UI_NotificationsServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Notifications not implemented")
|
||||
}
|
||||
func (UnimplementedUIServer) mustEmbedUnimplementedUIServer() {}
|
||||
|
||||
// UnsafeUIServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to UIServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeUIServer interface {
|
||||
mustEmbedUnimplementedUIServer()
|
||||
}
|
||||
|
||||
func RegisterUIServer(s grpc.ServiceRegistrar, srv UIServer) {
|
||||
s.RegisterService(&UI_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _UI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UIServer).Ping(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/protocol.UI/Ping",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UIServer).Ping(ctx, req.(*PingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UI_AskRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Connection)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UIServer).AskRule(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/protocol.UI/AskRule",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UIServer).AskRule(ctx, req.(*Connection))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UI_Subscribe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ClientConfig)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(UIServer).Subscribe(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/protocol.UI/Subscribe",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(UIServer).Subscribe(ctx, req.(*ClientConfig))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _UI_Notifications_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(UIServer).Notifications(&uINotificationsServer{stream})
|
||||
}
|
||||
|
||||
type UI_NotificationsServer interface {
|
||||
Send(*Notification) error
|
||||
Recv() (*NotificationReply, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type uINotificationsServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *uINotificationsServer) Send(m *Notification) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *uINotificationsServer) Recv() (*NotificationReply, error) {
|
||||
m := new(NotificationReply)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// UI_ServiceDesc is the grpc.ServiceDesc for UI service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var UI_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "protocol.UI",
|
||||
HandlerType: (*UIServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Ping",
|
||||
Handler: _UI_Ping_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AskRule",
|
||||
Handler: _UI_AskRule_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Subscribe",
|
||||
Handler: _UI_Subscribe_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Notifications",
|
||||
Handler: _UI_Notifications_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "ui.proto",
|
||||
}
|
Loading…
Add table
Reference in a new issue