Documentation
¶
Index ¶
- func AuthType() flowpb.AuthType
- func DropReason(options ...DropReasonOption) flowpb.DropReason
- func Endpoint(options ...EndpointOption) *flowpb.Endpoint
- func EventType() *flowpb.CiliumEventType
- func ICMPv4() *flowpb.ICMPv4
- func ICMPv6() *flowpb.ICMPv6
- func IsReply() *wrapperspb.BoolValue
- func Layer4(options ...Layer4Option) *flowpb.Layer4
- func New(options ...Option) *flowpb.Flow
- func Service(options ...ServiceOption) *flowpb.Service
- func TraceContext(options ...TraceContextOption) *flowpb.TraceContext
- func TraceObservationPoint() flowpb.TraceObservationPoint
- func TrafficDirection() flowpb.TrafficDirection
- func Verdict(options ...VerdictOption) flowpb.Verdict
- type DropReasonOption
- type EndpointOption
- type Layer4Option
- func WithLayer4DestinationPort(port uint32) Layer4Option
- func WithLayer4ICMPv4() Layer4Option
- func WithLayer4ICMPv6() Layer4Option
- func WithLayer4SCTP() Layer4Option
- func WithLayer4SourcePort(port uint32) Layer4Option
- func WithLayer4TCP() Layer4Option
- func WithLayer4TCPDestinationPort(port uint32) Layer4Option
- func WithLayer4TCPFlags(flags TCPFlags) Layer4Option
- func WithLayer4TCPSourcePort(port uint32) Layer4Option
- func WithLayer4UDP() Layer4Option
- func WithLayer4UDPDestinationPort(port uint32) Layer4Option
- func WithLayer4UDPSourcePort(port uint32) Layer4Option
- type Option
- func WithFlowAuthType(t flowpb.AuthType) Option
- func WithFlowDestinationNames(names []string) Option
- func WithFlowDropReason(r flowpb.DropReason) Option
- func WithFlowEndpoints(src, dst *flowpb.Endpoint) Option
- func WithFlowEthernet(e *flowpb.Ethernet) Option
- func WithFlowIP(ip *flowpb.IP) Option
- func WithFlowL4(l4 *flowpb.Layer4) Option
- func WithFlowNodeName(name string) Option
- func WithFlowSourceNames(names []string) Option
- func WithFlowTime(t time.Time) Option
- func WithFlowType(t flowpb.FlowType) Option
- func WithFlowVerdict(v flowpb.Verdict) Option
- func WithTraceContextProbability(probability float64) Option
- type ServiceOption
- type TCPFlags
- type TraceContextOption
- type VerdictOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropReason ¶
func DropReason(options ...DropReasonOption) flowpb.DropReason
DropReason generates a DropReason. Options may be provided to customize the drop reasons to return.
func Endpoint ¶
func Endpoint(options ...EndpointOption) *flowpb.Endpoint
Endpoint generates a random Endpoint. Options may be provided to customize the endpoint to return.
func IsReply ¶
func IsReply() *wrapperspb.BoolValue
IsReply returns either nil, or a wrapped boolean value reprenting true, or a wrapped boolean value reprenting false, with equal probability.
func Layer4 ¶
func Layer4(options ...Layer4Option) *flowpb.Layer4
Layer4 generates a layer 4. If no option is provided, it will be TCP.
func Service ¶
func Service(options ...ServiceOption) *flowpb.Service
Service generates a random Service. Options may be provided to customize the service to return.
func TraceContext ¶
func TraceContext(options ...TraceContextOption) *flowpb.TraceContext
TraceContext generates a TraceContext. Options may be provided to customize the returned object.
func TraceObservationPoint ¶
func TraceObservationPoint() flowpb.TraceObservationPoint
TraceObservationPoint generates a random TraceObservationPoint.
func TrafficDirection ¶
func TrafficDirection() flowpb.TrafficDirection
TrafficDirection generates a random TrafficDirection.
func Verdict ¶
func Verdict(options ...VerdictOption) flowpb.Verdict
Verdict generates a FORWARDED or DROPPPED verdict randomly. The probability of the verdict being FORWARDED can be set using WithVerdictForwardedProbability.
Types ¶
type DropReasonOption ¶
type DropReasonOption interface {
// contains filtered or unexported methods
}
DropReasonOption is an option to use with DropReason.
func WithDropReasonNonDropProbability ¶
func WithDropReasonNonDropProbability(probability float64) DropReasonOption
WithDropReasonNonDropProbability sets the probability of returning a non-drop drop reason (defaults to 0.999). The value must be between 0 and 1.
func WithDropReasonSubSet ¶
func WithDropReasonSubSet(dropReasons []flowpb.DropReason) DropReasonOption
WithDropReasonSubSet defines a set of DropReason to be returned. Note that this does not affect non-drop events. If non-drop events are not desired, use WithDropReasonNonDropProbability(0.0).
type EndpointOption ¶
type EndpointOption interface {
// contains filtered or unexported methods
}
EndpointOption is an option to use with Endpoint.
func WithEndpointLabels ¶
func WithEndpointLabels(labels []string) EndpointOption
WithEndpointLabels sets the labels of the endpoint.
func WithEndpointNamespace ¶
func WithEndpointNamespace(ns string) EndpointOption
WithEndpointNamespace sets the namespace of the endpoint.
func WithEndpointPodName ¶
func WithEndpointPodName(name string) EndpointOption
WithEndpointPodName sets the pod name of the endpoint.
func WithEndpointWorkloads ¶
func WithEndpointWorkloads(workloads map[string]string) EndpointOption
WithEndpointWorkloads sets the endpoint workloads. The map's keys are the workload names, and values are the workload kind.
type Layer4Option ¶
type Layer4Option interface {
// contains filtered or unexported methods
}
Layer4Option is an option to use with Layer4.
func WithLayer4DestinationPort ¶
func WithLayer4DestinationPort(port uint32) Layer4Option
WithLayer4DestinationPort specifies the destination port for UDP, TCP, and SCTP. Only useful in conjunction with either WithLayer4UDP, WithLayer4TCP, or WithLayer4SCTP.
func WithLayer4ICMPv4 ¶
func WithLayer4ICMPv4() Layer4Option
WithLayer4ICMPv4 specifies that the Layer4 should be ICMPv4.
func WithLayer4ICMPv6 ¶
func WithLayer4ICMPv6() Layer4Option
WithLayer4ICMPv6 specifies that the Layer4 should be ICMPv6.
func WithLayer4SCTP ¶
func WithLayer4SCTP() Layer4Option
WithLayer4SCTP specifies that the Layer4 should be SCTP.
func WithLayer4SourcePort ¶
func WithLayer4SourcePort(port uint32) Layer4Option
WithLayer4SourcePort specifies the source port for UDP, TCP, and SCTP. Only useful in conjunction with either WithLayer4UDP, WithLayer4TCP, or WithLayer4SCTP.
func WithLayer4TCP ¶
func WithLayer4TCP() Layer4Option
WithLayer4TCP specifies that the Layer4 should be TCP.
func WithLayer4TCPDestinationPort ¶
func WithLayer4TCPDestinationPort(port uint32) Layer4Option
WithLayer4TCPDestinationPort specifies the TCP destination port for Layer4. Only useful in conjunction with WithLayer4TCP. Deprecated: use WithLayer4DestinationPort instead.
func WithLayer4TCPFlags ¶
func WithLayer4TCPFlags(flags TCPFlags) Layer4Option
WithLayer4TCPFlags specifies the TCP flags for Layer4. Only useful in conjunction with WithLayer4TCP.
func WithLayer4TCPSourcePort ¶
func WithLayer4TCPSourcePort(port uint32) Layer4Option
WithLayer4TCPSourcePort specifies the TCP source port for Layer4. Only useful in conjunction with WithLayer4TCP. Deprecated: use WithLayer4SourcePort instead.
func WithLayer4UDP ¶
func WithLayer4UDP() Layer4Option
WithLayer4UDP specifies that the Layer4 should be UDP.
func WithLayer4UDPDestinationPort ¶
func WithLayer4UDPDestinationPort(port uint32) Layer4Option
WithLayer4UDPDestinationPort specifies the UDP destination port. Only useful in conjunction with WithLayer4UDP. Deprecated: use WithLayer4DestinationPort instead.
func WithLayer4UDPSourcePort ¶
func WithLayer4UDPSourcePort(port uint32) Layer4Option
WithLayer4UDPSourcePort specifies the UDP source port. Only useful in conjunction with WithLayer4UDP. Deprecated: use WithLayer4SourcePort instead.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an option to use with Flow.
func WithFlowAuthType ¶
WithFlowAuthType sets the authentication type field of a flow.
func WithFlowDestinationNames ¶
WithFlowDestinationNames sets the destination names field of a flow.
func WithFlowDropReason ¶
func WithFlowDropReason(r flowpb.DropReason) Option
WithFlowDropReason sets the drop reason of a flow.
func WithFlowEndpoints ¶
WithFlowEndpoints sets the source and destination endpoints of a flow.
func WithFlowEthernet ¶
WithFlowEthernet sets the ethernet field a flow.
func WithFlowNodeName ¶
WithFlowNodeName sets the node name field of a flow.
func WithFlowSourceNames ¶
WithFlowSourceNames sets the source names field of a flow.
func WithFlowType ¶
WithFlowType sets the type of the flow.
func WithFlowVerdict ¶
WithFlowVerdict sets the verdict of a flow.
func WithTraceContextProbability ¶
WithTraceContextProbability defines the probability for a flow to contain a trace context. The value must be between 0 and 1. Defaults to 0.1.
type ServiceOption ¶
type ServiceOption interface {
// contains filtered or unexported methods
}
ServiceOption is an option to use with Service.
func WithServiceName ¶
func WithServiceName(name string) ServiceOption
WithServiceName sets the name of the service.
func WithServiceNamespace ¶
func WithServiceNamespace(ns string) ServiceOption
WithServiceNamespace sets the namespace of the service.
type TraceContextOption ¶
type TraceContextOption interface {
// contains filtered or unexported methods
}
TraceContextOption is an option to use with TraceContext.
func WithTraceIDs ¶
func WithTraceIDs(traceIDs []string) TraceContextOption
WithTraceIDs defines a set of trace IDs to select from when generating trace contexts.
type VerdictOption ¶
type VerdictOption interface {
// contains filtered or unexported methods
}
VerdictOption is an option to use with Verdict.
func WithVerdictForwardedProbability ¶
func WithVerdictForwardedProbability(probability float64) VerdictOption
WithVerdictForwardedProbability sets the probability of returning a forwarded verdict (defaults to 0.999). The value must be between 0 and 1.