Documentation ¶
Overview ¶
Package frr implements the "Fake Rapid Response" service. It contains Fleetspeak modules that can be used to simulate GRR traffic through the Fleetspeak system for integration and load testing.
Index ¶
- Variables
- func ClientServiceFactory(conf *fspb.ClientServiceConfig) (cservice.Service, error)
- func ServerServiceFactory(sc *srpb.ServiceConfig) (service.Service, error)
- type MasterServer
- func (s *MasterServer) AllRequests(id common.ClientID) []int64
- func (s *MasterServer) CompletedRequests(ctx context.Context, id *fpb.CompletedRequestsRequest) (*fpb.CompletedRequestsResponse, error)
- func (s *MasterServer) CreateBroadcastRequest(ctx context.Context, rd *fpb.TrafficRequestData, limit uint64) error
- func (s *MasterServer) CreateFileDownloadHunt(ctx context.Context, name string, limit uint64) error
- func (s *MasterServer) CreateHunt(ctx context.Context, hr *fpb.CreateHuntRequest) (*fpb.CreateHuntResponse, error)
- func (s *MasterServer) GetCompletedRequests(id common.ClientID) []int64
- func (s *MasterServer) RecordFileResponse(ctx context.Context, i *fpb.FileResponseInfo) (*fspb.EmptyMessage, error)
- func (s *MasterServer) RecordTrafficResponse(ctx context.Context, i *fpb.MessageInfo) (*fspb.EmptyMessage, error)
- func (s *MasterServer) SetAdminClient(admin sgrpc.AdminClient)
- func (s *MasterServer) WatchCompleted() <-chan common.ClientID
Constants ¶
This section is empty.
Variables ¶
var DefaultFRRMaster fgrpc.MasterClient
DefaultFRRMaster sets a default connection to the FRR master server. This default will be used by the FRR ServerService if a configuration is not provided. It exists to allow special connection types.
Functions ¶
func ClientServiceFactory ¶
func ClientServiceFactory(conf *fspb.ClientServiceConfig) (cservice.Service, error)
ClientServiceFactory is a client.ServiceFactory which produces a frr client component.
func ServerServiceFactory ¶
func ServerServiceFactory(sc *srpb.ServiceConfig) (service.Service, error)
ServerServiceFactory is a server.ServiceFactory which produces a FRR server component. This component receives messages from clients and forwards them (via grpc calls) to a MasterServer.
Types ¶
type MasterServer ¶
type MasterServer struct { fgrpc.UnimplementedMasterServer // contains filtered or unexported fields }
A MasterServer implements fgrpc.MasterServer which records (in ram) metadata about received messages. It also provides methods to examine this metadata, check it for consistency and trigger FRR operations.
func NewMasterServer ¶
func NewMasterServer(admin sgrpc.AdminClient) *MasterServer
NewMasterServer returns MasterServer object.
func (*MasterServer) AllRequests ¶
func (s *MasterServer) AllRequests(id common.ClientID) []int64
AllRequests returns a list of all requests for the client which we've received any data for.
func (*MasterServer) CompletedRequests ¶
func (s *MasterServer) CompletedRequests(ctx context.Context, id *fpb.CompletedRequestsRequest) (*fpb.CompletedRequestsResponse, error)
CompletedRequests implements fgrpc.MasterServer and returns a list of requests made to a client which have been completed.
func (*MasterServer) CreateBroadcastRequest ¶
func (s *MasterServer) CreateBroadcastRequest(ctx context.Context, rd *fpb.TrafficRequestData, limit uint64) error
CreateBroadcastRequest initiates a hunt which sends the provided TrafficRequestData to every client, up to limit.
func (*MasterServer) CreateFileDownloadHunt ¶
CreateFileDownloadHunt initiates a hunt which requests that up to limit clients download the file identified by name.
func (*MasterServer) CreateHunt ¶
func (s *MasterServer) CreateHunt(ctx context.Context, hr *fpb.CreateHuntRequest) (*fpb.CreateHuntResponse, error)
CreateHunt implements fgrpc.MasterServer and initiates a hunt which sends the provided TrafficRequestData to provided clients, or to every client, up to limit, if ClientIds is empty
func (*MasterServer) GetCompletedRequests ¶
func (s *MasterServer) GetCompletedRequests(id common.ClientID) []int64
GetCompletedRequests returns a list of requests made to a client which have been completed.
func (*MasterServer) RecordFileResponse ¶
func (s *MasterServer) RecordFileResponse(ctx context.Context, i *fpb.FileResponseInfo) (*fspb.EmptyMessage, error)
RecordFileResponse implements fgrpc.MasterServer and records that the message was received.
func (*MasterServer) RecordTrafficResponse ¶
func (s *MasterServer) RecordTrafficResponse(ctx context.Context, i *fpb.MessageInfo) (*fspb.EmptyMessage, error)
RecordTrafficResponse implements fgrpc.MasterServer and records that the message was received.
func (*MasterServer) SetAdminClient ¶
func (s *MasterServer) SetAdminClient(admin sgrpc.AdminClient)
SetAdminClient changes the stub that is used to contact the FS server.
func (*MasterServer) WatchCompleted ¶
func (s *MasterServer) WatchCompleted() <-chan common.ClientID
WatchCompleted creates, and returns a channel which notifies when a request to a client is completed. Repeated calls return the same channel. Should only be called before the server is exported. (i.e. when it is idle)