Documentation ¶
Index ¶
- Variables
- func RegisterIpRepServer(s grpc.ServiceRegistrar, srv IpRepServer)
- type Aggregate
- func (a *Aggregate) AddEvent(e *Event)
- func (*Aggregate) Descriptor() ([]byte, []int)deprecated
- func (x *Aggregate) GetByType() []*AggregateTypeEntry
- func (a *Aggregate) GetCount(evType, ip string) (int64, bool)
- func (a *Aggregate) Merge(b *Aggregate) *Aggregate
- func (*Aggregate) ProtoMessage()
- func (x *Aggregate) ProtoReflect() protoreflect.Message
- func (a *Aggregate) Recalc()
- func (x *Aggregate) Reset()
- func (x *Aggregate) String() string
- type AggregateIPEntry
- func (*AggregateIPEntry) Descriptor() ([]byte, []int)deprecated
- func (x *AggregateIPEntry) GetCount() int64
- func (x *AggregateIPEntry) GetIp() string
- func (*AggregateIPEntry) ProtoMessage()
- func (x *AggregateIPEntry) ProtoReflect() protoreflect.Message
- func (x *AggregateIPEntry) Reset()
- func (x *AggregateIPEntry) String() string
- type AggregateTypeEntry
- func (*AggregateTypeEntry) Descriptor() ([]byte, []int)deprecated
- func (x *AggregateTypeEntry) GetByIp() []*AggregateIPEntry
- func (x *AggregateTypeEntry) GetDetails() string
- func (x *AggregateTypeEntry) GetType() string
- func (*AggregateTypeEntry) ProtoMessage()
- func (x *AggregateTypeEntry) ProtoReflect() protoreflect.Message
- func (x *AggregateTypeEntry) Reset()
- func (x *AggregateTypeEntry) String() string
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetCount() int64
- func (x *Event) GetDetails() string
- func (x *Event) GetIp() string
- func (x *Event) GetType() string
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type GetAllScoresRequest
- func (*GetAllScoresRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetAllScoresRequest) GetHorizon() int64
- func (x *GetAllScoresRequest) GetThreshold() float32
- func (*GetAllScoresRequest) ProtoMessage()
- func (x *GetAllScoresRequest) ProtoReflect() protoreflect.Message
- func (x *GetAllScoresRequest) Reset()
- func (x *GetAllScoresRequest) String() string
- type GetScoreRequest
- func (*GetScoreRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetScoreRequest) GetHorizon() int64
- func (x *GetScoreRequest) GetIp() string
- func (*GetScoreRequest) ProtoMessage()
- func (x *GetScoreRequest) ProtoReflect() protoreflect.Message
- func (x *GetScoreRequest) Reset()
- func (x *GetScoreRequest) String() string
- type GetScoreResponse
- func (*GetScoreResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetScoreResponse) GetIp() string
- func (x *GetScoreResponse) GetScore() float32
- func (*GetScoreResponse) ProtoMessage()
- func (x *GetScoreResponse) ProtoReflect() protoreflect.Message
- func (x *GetScoreResponse) Reset()
- func (x *GetScoreResponse) String() string
- type IPMask
- type IpRepClient
- type IpRepServer
- type IpRep_GetAllScoresClient
- type IpRep_GetAllScoresServer
- type Map
- type SubmitRequest
- func (*SubmitRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubmitRequest) GetAggregates() []*Aggregate
- func (x *SubmitRequest) GetEvents() []*Event
- func (*SubmitRequest) ProtoMessage()
- func (x *SubmitRequest) ProtoReflect() protoreflect.Message
- func (x *SubmitRequest) Reset()
- func (x *SubmitRequest) String() string
- type UnimplementedIpRepServer
- type UnsafeIpRepServer
Constants ¶
This section is empty.
Variables ¶
var DefaultIPMask = NewIPMask(32, 64)
var File_iprep_proto protoreflect.FileDescriptor
var IpRep_ServiceDesc = grpc.ServiceDesc{ ServiceName: "iprep.IpRep", HandlerType: (*IpRepServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Submit", Handler: _IpRep_Submit_Handler, }, { MethodName: "GetScore", Handler: _IpRep_GetScore_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetAllScores", Handler: _IpRep_GetAllScores_Handler, ServerStreams: true, }, }, Metadata: "iprep.proto", }
IpRep_ServiceDesc is the grpc.ServiceDesc for IpRep service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIpRepServer ¶
func RegisterIpRepServer(s grpc.ServiceRegistrar, srv IpRepServer)
Types ¶
type Aggregate ¶
type Aggregate struct { ByType []*AggregateTypeEntry `protobuf:"bytes,1,rep,name=by_type,json=byType,proto3" json:"by_type,omitempty"` // contains filtered or unexported fields }
func MakeAggregate ¶
MakeAggregate builds an Aggregate out of Events. Event details are lost in the aggregate.
func (*Aggregate) Descriptor
deprecated
func (*Aggregate) GetByType ¶
func (x *Aggregate) GetByType() []*AggregateTypeEntry
func (*Aggregate) ProtoMessage ¶
func (*Aggregate) ProtoMessage()
func (*Aggregate) ProtoReflect ¶
func (x *Aggregate) ProtoReflect() protoreflect.Message
type AggregateIPEntry ¶
type AggregateIPEntry struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*AggregateIPEntry) Descriptor
deprecated
func (*AggregateIPEntry) Descriptor() ([]byte, []int)
Deprecated: Use AggregateIPEntry.ProtoReflect.Descriptor instead.
func (*AggregateIPEntry) GetCount ¶
func (x *AggregateIPEntry) GetCount() int64
func (*AggregateIPEntry) GetIp ¶
func (x *AggregateIPEntry) GetIp() string
func (*AggregateIPEntry) ProtoMessage ¶
func (*AggregateIPEntry) ProtoMessage()
func (*AggregateIPEntry) ProtoReflect ¶
func (x *AggregateIPEntry) ProtoReflect() protoreflect.Message
func (*AggregateIPEntry) Reset ¶
func (x *AggregateIPEntry) Reset()
func (*AggregateIPEntry) String ¶
func (x *AggregateIPEntry) String() string
type AggregateTypeEntry ¶
type AggregateTypeEntry struct { ByIp []*AggregateIPEntry `protobuf:"bytes,1,rep,name=by_ip,json=byIp,proto3" json:"by_ip,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` // contains filtered or unexported fields }
func (*AggregateTypeEntry) Descriptor
deprecated
func (*AggregateTypeEntry) Descriptor() ([]byte, []int)
Deprecated: Use AggregateTypeEntry.ProtoReflect.Descriptor instead.
func (*AggregateTypeEntry) GetByIp ¶
func (x *AggregateTypeEntry) GetByIp() []*AggregateIPEntry
func (*AggregateTypeEntry) GetDetails ¶
func (x *AggregateTypeEntry) GetDetails() string
func (*AggregateTypeEntry) GetType ¶
func (x *AggregateTypeEntry) GetType() string
func (*AggregateTypeEntry) ProtoMessage ¶
func (*AggregateTypeEntry) ProtoMessage()
func (*AggregateTypeEntry) ProtoReflect ¶
func (x *AggregateTypeEntry) ProtoReflect() protoreflect.Message
func (*AggregateTypeEntry) Reset ¶
func (x *AggregateTypeEntry) Reset()
func (*AggregateTypeEntry) String ¶
func (x *AggregateTypeEntry) String() string
type Event ¶
type Event struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
func (*Event) GetDetails ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type GetAllScoresRequest ¶
type GetAllScoresRequest struct { Horizon int64 `protobuf:"varint,1,opt,name=horizon,proto3" json:"horizon,omitempty"` Threshold float32 `protobuf:"fixed32,2,opt,name=threshold,proto3" json:"threshold,omitempty"` // contains filtered or unexported fields }
func (*GetAllScoresRequest) Descriptor
deprecated
func (*GetAllScoresRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAllScoresRequest.ProtoReflect.Descriptor instead.
func (*GetAllScoresRequest) GetHorizon ¶
func (x *GetAllScoresRequest) GetHorizon() int64
func (*GetAllScoresRequest) GetThreshold ¶
func (x *GetAllScoresRequest) GetThreshold() float32
func (*GetAllScoresRequest) ProtoMessage ¶
func (*GetAllScoresRequest) ProtoMessage()
func (*GetAllScoresRequest) ProtoReflect ¶
func (x *GetAllScoresRequest) ProtoReflect() protoreflect.Message
func (*GetAllScoresRequest) Reset ¶
func (x *GetAllScoresRequest) Reset()
func (*GetAllScoresRequest) String ¶
func (x *GetAllScoresRequest) String() string
type GetScoreRequest ¶
type GetScoreRequest struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Horizon int64 `protobuf:"varint,2,opt,name=horizon,proto3" json:"horizon,omitempty"` // contains filtered or unexported fields }
func (*GetScoreRequest) Descriptor
deprecated
func (*GetScoreRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetScoreRequest.ProtoReflect.Descriptor instead.
func (*GetScoreRequest) GetHorizon ¶
func (x *GetScoreRequest) GetHorizon() int64
func (*GetScoreRequest) GetIp ¶
func (x *GetScoreRequest) GetIp() string
func (*GetScoreRequest) ProtoMessage ¶
func (*GetScoreRequest) ProtoMessage()
func (*GetScoreRequest) ProtoReflect ¶
func (x *GetScoreRequest) ProtoReflect() protoreflect.Message
func (*GetScoreRequest) Reset ¶
func (x *GetScoreRequest) Reset()
func (*GetScoreRequest) String ¶
func (x *GetScoreRequest) String() string
type GetScoreResponse ¶
type GetScoreResponse struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"` // contains filtered or unexported fields }
func (*GetScoreResponse) Descriptor
deprecated
func (*GetScoreResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetScoreResponse.ProtoReflect.Descriptor instead.
func (*GetScoreResponse) GetIp ¶
func (x *GetScoreResponse) GetIp() string
func (*GetScoreResponse) GetScore ¶
func (x *GetScoreResponse) GetScore() float32
func (*GetScoreResponse) ProtoMessage ¶
func (*GetScoreResponse) ProtoMessage()
func (*GetScoreResponse) ProtoReflect ¶
func (x *GetScoreResponse) ProtoReflect() protoreflect.Message
func (*GetScoreResponse) Reset ¶
func (x *GetScoreResponse) Reset()
func (*GetScoreResponse) String ¶
func (x *GetScoreResponse) String() string
type IPMask ¶
type IPMask struct {
// contains filtered or unexported fields
}
IPMask is a utility type to mask v4/v6 addresses retaining different number of bits for each protocol.
func (IPMask) MaskString ¶
type IpRepClient ¶
type IpRepClient interface { Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*empty.Empty, error) GetScore(ctx context.Context, in *GetScoreRequest, opts ...grpc.CallOption) (*GetScoreResponse, error) GetAllScores(ctx context.Context, in *GetAllScoresRequest, opts ...grpc.CallOption) (IpRep_GetAllScoresClient, error) }
IpRepClient is the client API for IpRep 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 NewIpRepClient ¶
func NewIpRepClient(cc grpc.ClientConnInterface) IpRepClient
type IpRepServer ¶
type IpRepServer interface { Submit(context.Context, *SubmitRequest) (*empty.Empty, error) GetScore(context.Context, *GetScoreRequest) (*GetScoreResponse, error) GetAllScores(*GetAllScoresRequest, IpRep_GetAllScoresServer) error // contains filtered or unexported methods }
IpRepServer is the server API for IpRep service. All implementations must embed UnimplementedIpRepServer for forward compatibility
type IpRep_GetAllScoresClient ¶
type IpRep_GetAllScoresClient interface { Recv() (*GetScoreResponse, error) grpc.ClientStream }
type IpRep_GetAllScoresServer ¶
type IpRep_GetAllScoresServer interface { Send(*GetScoreResponse) error grpc.ServerStream }
type SubmitRequest ¶
type SubmitRequest struct { Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` Aggregates []*Aggregate `protobuf:"bytes,2,rep,name=aggregates,proto3" json:"aggregates,omitempty"` // contains filtered or unexported fields }
func (*SubmitRequest) Descriptor
deprecated
func (*SubmitRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubmitRequest.ProtoReflect.Descriptor instead.
func (*SubmitRequest) GetAggregates ¶
func (x *SubmitRequest) GetAggregates() []*Aggregate
func (*SubmitRequest) GetEvents ¶
func (x *SubmitRequest) GetEvents() []*Event
func (*SubmitRequest) ProtoMessage ¶
func (*SubmitRequest) ProtoMessage()
func (*SubmitRequest) ProtoReflect ¶
func (x *SubmitRequest) ProtoReflect() protoreflect.Message
func (*SubmitRequest) Reset ¶
func (x *SubmitRequest) Reset()
func (*SubmitRequest) String ¶
func (x *SubmitRequest) String() string
type UnimplementedIpRepServer ¶
type UnimplementedIpRepServer struct { }
UnimplementedIpRepServer must be embedded to have forward compatible implementations.
func (UnimplementedIpRepServer) GetAllScores ¶
func (UnimplementedIpRepServer) GetAllScores(*GetAllScoresRequest, IpRep_GetAllScoresServer) error
func (UnimplementedIpRepServer) GetScore ¶
func (UnimplementedIpRepServer) GetScore(context.Context, *GetScoreRequest) (*GetScoreResponse, error)
func (UnimplementedIpRepServer) Submit ¶
func (UnimplementedIpRepServer) Submit(context.Context, *SubmitRequest) (*empty.Empty, error)
type UnsafeIpRepServer ¶
type UnsafeIpRepServer interface {
// contains filtered or unexported methods
}
UnsafeIpRepServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IpRepServer will result in compilation errors.