in pipeline/builder/builder.go [108:127]
func createEndpoint(config *config.Config, cfgep *config.Endpoint, agentId string) (pipeline.Endpoint, error) {
if cfgep.Disk != nil {
return endpoints.NewDiskEndpoint(
cfgep.Name,
cfgep.Disk.ReportDir,
time.Duration(cfgep.Disk.ExpireSeconds)*time.Second,
), nil
}
if cfgep.ServiceControl != nil {
return endpoints.NewServiceControlEndpoint(
cfgep.Name,
cfgep.ServiceControl.ServiceName,
agentId,
cfgep.ServiceControl.ConsumerId,
config.Identities.Get(cfgep.ServiceControl.Identity).GCP.GetServiceAccountKey(),
)
}
// TODO(volkman): support pubsub
return nil, errors.New("unsupported endpoint")
}