Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterFlowHandlerServer(s grpc.ServiceRegistrar, srv FlowHandlerServer)
- type FlowHandlerClient
- type FlowHandlerServer
- type FlowHandler_SubmitClient
- type FlowHandler_SubmitServer
- type Observation
- func (*Observation) Descriptor() ([]byte, []int)deprecated
- func (x *Observation) GetFlow() *Observation_Flow
- func (x *Observation) GetNodeName() string
- func (x *Observation) GetTimestamp() uint64
- func (*Observation) ProtoMessage()
- func (x *Observation) ProtoReflect() protoreflect.Message
- func (x *Observation) Reset()
- func (x *Observation) String() string
- type ObservationSummary
- func (*ObservationSummary) Descriptor() ([]byte, []int)deprecated
- func (x *ObservationSummary) GetObservationCount() uint32
- func (*ObservationSummary) ProtoMessage()
- func (x *ObservationSummary) ProtoReflect() protoreflect.Message
- func (x *ObservationSummary) Reset()
- func (x *ObservationSummary) String() string
- type Observation_Flow
- func (*Observation_Flow) Descriptor() ([]byte, []int)deprecated
- func (x *Observation_Flow) GetOriginal() *Observation_Flow_FlowTuple
- func (x *Observation_Flow) GetProto() uint32
- func (x *Observation_Flow) GetReply() *Observation_Flow_FlowTuple
- func (*Observation_Flow) ProtoMessage()
- func (x *Observation_Flow) ProtoReflect() protoreflect.Message
- func (x *Observation_Flow) Reset()
- func (x *Observation_Flow) String() string
- type Observation_Flow_FlowTuple
- func (*Observation_Flow_FlowTuple) Descriptor() ([]byte, []int)deprecated
- func (x *Observation_Flow_FlowTuple) GetBytes() uint64
- func (x *Observation_Flow_FlowTuple) GetDestination() *Observation_Flow_FlowTuple_L4Endpoint
- func (x *Observation_Flow_FlowTuple) GetPackets() uint64
- func (x *Observation_Flow_FlowTuple) GetSource() *Observation_Flow_FlowTuple_L4Endpoint
- func (*Observation_Flow_FlowTuple) ProtoMessage()
- func (x *Observation_Flow_FlowTuple) ProtoReflect() protoreflect.Message
- func (x *Observation_Flow_FlowTuple) Reset()
- func (x *Observation_Flow_FlowTuple) String() string
- type Observation_Flow_FlowTuple_L4Endpoint
- func (*Observation_Flow_FlowTuple_L4Endpoint) Descriptor() ([]byte, []int)deprecated
- func (m *Observation_Flow_FlowTuple_L4Endpoint) GetIpAddr() isObservation_Flow_FlowTuple_L4Endpoint_IpAddr
- func (x *Observation_Flow_FlowTuple_L4Endpoint) GetPort() uint32
- func (x *Observation_Flow_FlowTuple_L4Endpoint) GetV4() uint32
- func (x *Observation_Flow_FlowTuple_L4Endpoint) GetV6() []byte
- func (*Observation_Flow_FlowTuple_L4Endpoint) ProtoMessage()
- func (x *Observation_Flow_FlowTuple_L4Endpoint) ProtoReflect() protoreflect.Message
- func (x *Observation_Flow_FlowTuple_L4Endpoint) Reset()
- func (x *Observation_Flow_FlowTuple_L4Endpoint) String() string
- type Observation_Flow_FlowTuple_L4Endpoint_V4
- type Observation_Flow_FlowTuple_L4Endpoint_V6
- type UnimplementedFlowHandlerServer
- type UnsafeFlowHandlerServer
Constants ¶
const (
FlowHandler_Submit_FullMethodName = "/grpc.FlowHandler/Submit"
)
Variables ¶
var File_grpc_flow_handler_proto protoreflect.FileDescriptor
var FlowHandler_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpc.FlowHandler", HandlerType: (*FlowHandlerServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Submit", Handler: _FlowHandler_Submit_Handler, ClientStreams: true, }, }, Metadata: "grpc/flow_handler.proto", }
FlowHandler_ServiceDesc is the grpc.ServiceDesc for FlowHandler service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterFlowHandlerServer ¶
func RegisterFlowHandlerServer(s grpc.ServiceRegistrar, srv FlowHandlerServer)
Types ¶
type FlowHandlerClient ¶
type FlowHandlerClient interface {
// Submit is a streaming RPC that accepts a stream of Observations from
// conntrack and returns a summary with the number of processed
// observations.
Submit(ctx context.Context, opts ...grpc.CallOption) (FlowHandler_SubmitClient, error)
}
FlowHandlerClient is the client API for FlowHandler 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.
func NewFlowHandlerClient ¶
func NewFlowHandlerClient(cc grpc.ClientConnInterface) FlowHandlerClient
type FlowHandlerServer ¶
type FlowHandlerServer interface {
// Submit is a streaming RPC that accepts a stream of Observations from
// conntrack and returns a summary with the number of processed
// observations.
Submit(FlowHandler_SubmitServer) error
// contains filtered or unexported methods
}
FlowHandlerServer is the server API for FlowHandler service. All implementations must embed UnimplementedFlowHandlerServer for forward compatibility
type FlowHandler_SubmitClient ¶
type FlowHandler_SubmitClient interface {
Send(*Observation) error
CloseAndRecv() (*ObservationSummary, error)
grpc.ClientStream
}
type FlowHandler_SubmitServer ¶
type FlowHandler_SubmitServer interface {
SendAndClose(*ObservationSummary) error
Recv() (*Observation, error)
grpc.ServerStream
}
type Observation ¶
type Observation struct {
// The flow observed.
Flow *Observation_Flow `protobuf:"bytes,1,opt,name=flow,proto3" json:"flow,omitempty"`
// The node on which the flow was observed.
NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
// The timestamp, in Unix seconds, when the flow was observed.
Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// contains filtered or unexported fields
}
Observation describes a conntrack entry, as well as when and where it was taken.
func (*Observation) Descriptor
deprecated
func (*Observation) Descriptor() ([]byte, []int)
Deprecated: Use Observation.ProtoReflect.Descriptor instead.
func (*Observation) GetFlow ¶
func (x *Observation) GetFlow() *Observation_Flow
func (*Observation) GetNodeName ¶
func (x *Observation) GetNodeName() string
func (*Observation) GetTimestamp ¶
func (x *Observation) GetTimestamp() uint64
func (*Observation) ProtoMessage ¶
func (*Observation) ProtoMessage()
func (*Observation) ProtoReflect ¶
func (x *Observation) ProtoReflect() protoreflect.Message
func (*Observation) Reset ¶
func (x *Observation) Reset()
func (*Observation) String ¶
func (x *Observation) String() string
type ObservationSummary ¶
type ObservationSummary struct {
// The number of observations processed during the stream.
ObservationCount uint32 `protobuf:"varint,1,opt,name=observation_count,json=observationCount,proto3" json:"observation_count,omitempty"`
// contains filtered or unexported fields
}
ObservationSummary is a simple message returned once a Submit stream is interrupted.
func (*ObservationSummary) Descriptor
deprecated
func (*ObservationSummary) Descriptor() ([]byte, []int)
Deprecated: Use ObservationSummary.ProtoReflect.Descriptor instead.
func (*ObservationSummary) GetObservationCount ¶
func (x *ObservationSummary) GetObservationCount() uint32
func (*ObservationSummary) ProtoMessage ¶
func (*ObservationSummary) ProtoMessage()
func (*ObservationSummary) ProtoReflect ¶
func (x *ObservationSummary) ProtoReflect() protoreflect.Message
func (*ObservationSummary) Reset ¶
func (x *ObservationSummary) Reset()
func (*ObservationSummary) String ¶
func (x *ObservationSummary) String() string
type Observation_Flow ¶
type Observation_Flow struct {
Proto uint32 `protobuf:"varint,1,opt,name=proto,proto3" json:"proto,omitempty"`
// The original tuple when opening the connection.
Original *Observation_Flow_FlowTuple `protobuf:"bytes,2,opt,name=original,proto3" json:"original,omitempty"`
// The reply tuple. In the simple case, this is a mirror image of the
// original tuple (with the exception for the packet and byte counters),
// but sometimes it is different, e.g. due to NAT.
Reply *Observation_Flow_FlowTuple `protobuf:"bytes,3,opt,name=reply,proto3" json:"reply,omitempty"`
// contains filtered or unexported fields
}
Flow represents row of conntrack -L output.
func (*Observation_Flow) Descriptor
deprecated
func (*Observation_Flow) Descriptor() ([]byte, []int)
Deprecated: Use Observation_Flow.ProtoReflect.Descriptor instead.
func (*Observation_Flow) GetOriginal ¶
func (x *Observation_Flow) GetOriginal() *Observation_Flow_FlowTuple
func (*Observation_Flow) GetProto ¶
func (x *Observation_Flow) GetProto() uint32
func (*Observation_Flow) GetReply ¶
func (x *Observation_Flow) GetReply() *Observation_Flow_FlowTuple
func (*Observation_Flow) ProtoMessage ¶
func (*Observation_Flow) ProtoMessage()
func (*Observation_Flow) ProtoReflect ¶
func (x *Observation_Flow) ProtoReflect() protoreflect.Message
func (*Observation_Flow) Reset ¶
func (x *Observation_Flow) Reset()
func (*Observation_Flow) String ¶
func (x *Observation_Flow) String() string
type Observation_Flow_FlowTuple ¶
type Observation_Flow_FlowTuple struct {
// Source tuple.
Source *Observation_Flow_FlowTuple_L4Endpoint `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
// Destination tuple.
Destination *Observation_Flow_FlowTuple_L4Endpoint `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
// Number of packets seen from source to destination.
Packets uint64 `protobuf:"varint,3,opt,name=packets,proto3" json:"packets,omitempty"`
// Number of bytes seen from source to destination.
Bytes uint64 `protobuf:"varint,4,opt,name=bytes,proto3" json:"bytes,omitempty"`
// contains filtered or unexported fields
}
FlowTuple represents one direction of a connection.
func (*Observation_Flow_FlowTuple) Descriptor
deprecated
func (*Observation_Flow_FlowTuple) Descriptor() ([]byte, []int)
Deprecated: Use Observation_Flow_FlowTuple.ProtoReflect.Descriptor instead.
func (*Observation_Flow_FlowTuple) GetBytes ¶
func (x *Observation_Flow_FlowTuple) GetBytes() uint64
func (*Observation_Flow_FlowTuple) GetDestination ¶
func (x *Observation_Flow_FlowTuple) GetDestination() *Observation_Flow_FlowTuple_L4Endpoint
func (*Observation_Flow_FlowTuple) GetPackets ¶
func (x *Observation_Flow_FlowTuple) GetPackets() uint64
func (*Observation_Flow_FlowTuple) GetSource ¶
func (x *Observation_Flow_FlowTuple) GetSource() *Observation_Flow_FlowTuple_L4Endpoint
func (*Observation_Flow_FlowTuple) ProtoMessage ¶
func (*Observation_Flow_FlowTuple) ProtoMessage()
func (*Observation_Flow_FlowTuple) ProtoReflect ¶
func (x *Observation_Flow_FlowTuple) ProtoReflect() protoreflect.Message
func (*Observation_Flow_FlowTuple) Reset ¶
func (x *Observation_Flow_FlowTuple) Reset()
func (*Observation_Flow_FlowTuple) String ¶
func (x *Observation_Flow_FlowTuple) String() string
type Observation_Flow_FlowTuple_L4Endpoint ¶
type Observation_Flow_FlowTuple_L4Endpoint struct {
// IP.
//
// Types that are assignable to IpAddr:
//
// *Observation_Flow_FlowTuple_L4Endpoint_V4
// *Observation_Flow_FlowTuple_L4Endpoint_V6
IpAddr isObservation_Flow_FlowTuple_L4Endpoint_IpAddr `protobuf_oneof:"ip_addr"`
// Port (uint16 doesn't exist in protobuf).
Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
// contains filtered or unexported fields
}
L4 Endpoint is an (IP, port) tuple.
func (*Observation_Flow_FlowTuple_L4Endpoint) Descriptor
deprecated
func (*Observation_Flow_FlowTuple_L4Endpoint) Descriptor() ([]byte, []int)
Deprecated: Use Observation_Flow_FlowTuple_L4Endpoint.ProtoReflect.Descriptor instead.
func (*Observation_Flow_FlowTuple_L4Endpoint) GetIpAddr ¶
func (m *Observation_Flow_FlowTuple_L4Endpoint) GetIpAddr() isObservation_Flow_FlowTuple_L4Endpoint_IpAddr
func (*Observation_Flow_FlowTuple_L4Endpoint) GetPort ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) GetPort() uint32
func (*Observation_Flow_FlowTuple_L4Endpoint) GetV4 ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) GetV4() uint32
func (*Observation_Flow_FlowTuple_L4Endpoint) GetV6 ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) GetV6() []byte
func (*Observation_Flow_FlowTuple_L4Endpoint) ProtoMessage ¶
func (*Observation_Flow_FlowTuple_L4Endpoint) ProtoMessage()
func (*Observation_Flow_FlowTuple_L4Endpoint) ProtoReflect ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) ProtoReflect() protoreflect.Message
func (*Observation_Flow_FlowTuple_L4Endpoint) Reset ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) Reset()
func (*Observation_Flow_FlowTuple_L4Endpoint) String ¶
func (x *Observation_Flow_FlowTuple_L4Endpoint) String() string
type Observation_Flow_FlowTuple_L4Endpoint_V4 ¶
type Observation_Flow_FlowTuple_L4Endpoint_V4 struct {
// IPv4.
V4 uint32 `protobuf:"fixed32,1,opt,name=v4,proto3,oneof"`
}
type Observation_Flow_FlowTuple_L4Endpoint_V6 ¶
type Observation_Flow_FlowTuple_L4Endpoint_V6 struct {
// IPv6.
V6 []byte `protobuf:"bytes,2,opt,name=v6,proto3,oneof"`
}
type UnimplementedFlowHandlerServer ¶
type UnimplementedFlowHandlerServer struct {
}
UnimplementedFlowHandlerServer must be embedded to have forward compatible implementations.
func (UnimplementedFlowHandlerServer) Submit ¶
func (UnimplementedFlowHandlerServer) Submit(FlowHandler_SubmitServer) error
type UnsafeFlowHandlerServer ¶
type UnsafeFlowHandlerServer interface {
// contains filtered or unexported methods
}
UnsafeFlowHandlerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FlowHandlerServer will result in compilation errors.