Documentation
¶
Index ¶
- Variables
- type Joiner
- type MyTracerouteHub
- type MyTracerouteMTR
- type MyTracerouteReport
- type MyTracerouteResult
- type Netlink
- type Netlinker
- type Option
- type QAAgent
- func (q *QAAgent) ConnectMulticast(ctx context.Context, req *pb.ConnectMulticastRequest) (*pb.Result, error)
- func (q *QAAgent) ConnectUnicast(ctx context.Context, req *pb.ConnectUnicastRequest) (*pb.Result, error)
- func (q *QAAgent) CreateMulticastGroup(ctx context.Context, req *pb.CreateMulticastGroupRequest) (*pb.Result, error)
- func (q *QAAgent) DeleteMulticastGroup(ctx context.Context, req *pb.DeleteMulticastGroupRequest) (*pb.Result, error)
- func (q *QAAgent) Disconnect(ctx context.Context, req *emptypb.Empty) (*pb.Result, error)
- func (q *QAAgent) GetPublicIP(ctx context.Context, req *emptypb.Empty) (*pb.GetPublicIPResponse, error)
- func (q *QAAgent) GetRoutes(ctx context.Context, req *emptypb.Empty) (*pb.GetRoutesResponse, error)
- func (q *QAAgent) GetStatus(ctx context.Context, req *emptypb.Empty) (*pb.StatusResponse, error)
- func (q *QAAgent) MulticastAllowListAdd(ctx context.Context, req *pb.MulticastAllowListAddRequest) (*pb.Result, error)
- func (q *QAAgent) MulticastJoin(ctx context.Context, req *pb.MulticastJoinRequest) (*pb.MulticastJoinResult, error)
- func (q *QAAgent) MulticastLeave(ctx context.Context, in *emptypb.Empty) (*emptypb.Empty, error)
- func (q *QAAgent) MulticastReport(ctx context.Context, req *pb.MulticastReportRequest) (*pb.MulticastReportResult, error)
- func (q *QAAgent) MulticastSend(ctx context.Context, req *pb.MulticastSendRequest) (*emptypb.Empty, error)
- func (q *QAAgent) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResult, error)
- func (q *QAAgent) Start(ctx context.Context) error
- func (q *QAAgent) Traceroute(ctx context.Context, req *pb.TracerouteRequest) (*pb.TracerouteResult, error)
- func (q *QAAgent) TracerouteRaw(ctx context.Context, req *pb.TracerouteRequest) (*pb.Result, error)
- type Route
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
var ( BuildInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{ Name: "doublezero_qaagent_build_info", Help: "Build information of the QA agent", }, []string{"version", "commit", "date"}, ) PingPacketsLostTotal = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "doublezero_qaagent_ping_packets_lost_total", Help: "Total number of packets lost during ping tests", }, []string{"source_ip", "target_ip"}, ) UserConnectDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "doublezero_qaagent_user_connect_duration_seconds", Help: "Duration of connect operations", Buckets: prometheus.ExponentialBuckets(1, 1.5, 12), }, []string{"user_type"}) UserDisconnectDuration = promauto.NewHistogram(prometheus.HistogramOpts{ Name: "doublezero_qaagent_user_disconnect_duration_seconds", Help: "Duration of disconnect operations", Buckets: prometheus.ExponentialBuckets(1, 1.5, 12), }) )
Functions ¶
This section is empty.
Types ¶
type MyTracerouteHub ¶ added in v0.7.2
type MyTracerouteMTR ¶ added in v0.7.2
type MyTracerouteReport ¶ added in v0.7.2
type MyTracerouteReport struct {
MTR MyTracerouteMTR `json:"mtr"`
Hubs []MyTracerouteHub `json:"hubs"`
}
type MyTracerouteResult ¶ added in v0.7.2
type MyTracerouteResult struct {
Report MyTracerouteReport `json:"report"`
}
type Netlink ¶ added in v0.7.2
type Netlink struct{}
func (*Netlink) RouteByProtocol ¶ added in v0.7.2
type Option ¶
type Option func(*QAAgent)
func WithDZClient ¶ added in v0.7.2
func WithDZStatusURL ¶ added in v0.7.2
func WithJoiner ¶ added in v0.7.2
func WithNetlinker ¶ added in v0.7.2
type QAAgent ¶
type QAAgent struct {
pb.UnimplementedQAAgentServiceServer
// contains filtered or unexported fields
}
func NewQAAgent ¶
NewQAAgent creates a new QAAgent instance. It accepts an address (i.e. localhost:443) to listen on and a Joiner interface for managing multicast group joins.
func (*QAAgent) ConnectMulticast ¶
func (q *QAAgent) ConnectMulticast(ctx context.Context, req *pb.ConnectMulticastRequest) (*pb.Result, error)
ConnectMulticast implements the ConnectMulticast RPC, which connects to a multicast group as either a publisher or subscriber. This call will block until the tunnel is up according to the DoubleZero status output or return an error if the tunnel is not up within 60 seconds.
func (*QAAgent) ConnectUnicast ¶
func (q *QAAgent) ConnectUnicast(ctx context.Context, req *pb.ConnectUnicastRequest) (*pb.Result, error)
ConnectUnicast implements the ConnectUnicast RPC. This establishes a unicast tunnel to DoubleZero using IBRL mode. This call will block until the tunnel is up according to the DoubleZero status output or return an error if the tunnel is not up within 20 seconds.
func (*QAAgent) CreateMulticastGroup ¶
func (q *QAAgent) CreateMulticastGroup(ctx context.Context, req *pb.CreateMulticastGroupRequest) (*pb.Result, error)
CreateMulticastGroup implements the CreateMulticastGroup RPC, which creates a multicast group with the specified code and maximum bandwidth.
func (*QAAgent) DeleteMulticastGroup ¶
func (q *QAAgent) DeleteMulticastGroup(ctx context.Context, req *pb.DeleteMulticastGroupRequest) (*pb.Result, error)
DeleteMulticastGroup implements the DeleteMulticastGroup RPC, which deletes a multicast group by its public key.
func (*QAAgent) Disconnect ¶
Disconnect implements the Disconnect RPC, which removes the current tunnel from DoubleZero.
func (*QAAgent) GetPublicIP ¶ added in v0.7.2
func (*QAAgent) GetRoutes ¶ added in v0.7.2
GetRoutes implements the GetRoutes RPC, which retrieves the installed routes in the kernel routing table.
func (*QAAgent) GetStatus ¶
GetStatus implements the GetStatus RPC, which retrieves the current status of the configured DoubleZero tunnel. This is equivalent to the `doublezero status` command.
func (*QAAgent) MulticastAllowListAdd ¶
func (q *QAAgent) MulticastAllowListAdd(ctx context.Context, req *pb.MulticastAllowListAddRequest) (*pb.Result, error)
MulticastAllowListAdd implements the MulticastAllowListAdd RPC, which adds a publisher or subscriber to the multicast allowlist for a specific group.
func (*QAAgent) MulticastJoin ¶
func (q *QAAgent) MulticastJoin(ctx context.Context, req *pb.MulticastJoinRequest) (*pb.MulticastJoinResult, error)
MulticastJoin implements the MulticastJoin RPC, joins the requested multicast group and counts received packets per joined group. Use the GetStatistics RPC to retrieve the stats.
func (*QAAgent) MulticastLeave ¶
MulticastLeave implements the MulticastLeave RPC and stops listening to all multicast groups.
func (*QAAgent) MulticastReport ¶
func (q *QAAgent) MulticastReport(ctx context.Context, req *pb.MulticastReportRequest) (*pb.MulticastReportResult, error)
MulticastReport implements the MulticastReport RPC, which retrieves statistics for multicast groups that the agent is currently listening to. It returns the number of packets received for each group.
func (*QAAgent) MulticastSend ¶
func (q *QAAgent) MulticastSend(ctx context.Context, req *pb.MulticastSendRequest) (*emptypb.Empty, error)
MulticastSend implements the MulticastSend RPC, which sends multicast packets to a specified group for a given duration.
func (*QAAgent) Ping ¶
func (q *QAAgent) Ping(ctx context.Context, req *pb.PingRequest) (*pb.PingResult, error)
Ping implements the Ping RPC, executes a set of ICMP pings, and reports the results to the caller. This requires CAP_NET_RAW capability to run successfully due to the use of raw sockets.
func (*QAAgent) Start ¶
Start starts the QAAgent and blocks until the context is done or an error occurs.
func (*QAAgent) Traceroute ¶ added in v0.7.2
func (q *QAAgent) Traceroute(ctx context.Context, req *pb.TracerouteRequest) (*pb.TracerouteResult, error)
Traceroute implements the Traceroute RPC, which traces the route to the target IP, and returns the results.
func (*QAAgent) TracerouteRaw ¶ added in v0.7.2
TracerouteRaw implements the TracerouteRaw RPC, which traces the route to the target IP, and returns the raw output.
type StatusResponse ¶
type StatusResponse struct {
Response struct {
TunnelName string `json:"tunnel_name"`
TunnelSrc string `json:"tunnel_src"`
TunnelDst string `json:"tunnel_dst"`
DoubleZeroIP string `json:"doublezero_ip"`
UserType string `json:"user_type"`
DoubleZeroStatus struct {
SessionStatus string `json:"session_status"`
LastSessionUpdate int64 `json:"last_session_update"`
} `json:"doublezero_status"`
} `json:"response"`
CurrentDevice string `json:"current_device"`
LowestLatencyDevice string `json:"lowest_latency_device"`
Metro string `json:"metro"`
Network string `json:"network"`
}