func (m *Manager) Collect(s *watcherpb.WatcherDetails) (bool, error) {

	// Client
	config := &tls.Config{}
	conn, err := grpc.Dial("collector-ak2zgjnhlq-ts.a.run.app:443", grpc.WithTransportCredentials(credentials.NewTLS(config)))
	if err != nil {
		log.Errorf("error dialing: %v", err)
	}
	defer conn.Close()
	c := collectorpb.NewCollectorServiceClient(conn)

	for _, docs := range m.index.GetEntries().GetDocuments() {
		document := docs.GetDocument()[0]
		collectUrl, err := getUrl(document)
		if err != nil {
			return false, err
		}
		log.Infof(context.TODO(), "collecting source: %s", collectUrl)
		resourceCollected, err := c.GetSource(context.TODO(), &collectorpb.GetSourceRequest{
			Url:    collectUrl,
			Format: document.Metadata.Format,
			Parser: s.Spec.Source.Parser})
		if err != nil {
			log.Errorf("error collecting source, error: %v", err)
		}
		log.Infof(context.TODO(), "resourceCollected:info:%+v", resourceCollected)
		break
	}
	return true, nil
}
// Collect will fetch all documents found missing for the given syncronisation process
Collect will fetch all documents found missing for the given syncronisation process
// Collect will fetch all documents found missing for the given syncronisation process
func (m *Manager) Collect(s *watcherpb.WatcherDetails) (bool, error) {
	config := &tls.Config{}
	conn, err := grpc.Dial("collector-ak2zgjnhlq-ts.a.run.app:443", grpc.WithTransportCredentials(credentials.NewTLS(config)))
	if err != nil {
		log.Errorf("error dialing: %v", err)
	}
	defer conn.Close()
	c := collectorpb.NewCollectorServiceClient(conn)
	for _, docs := range m.index.GetEntries().GetDocuments() {
		document := docs.GetDocument()[0]
		collectUrl, err := getUrl(document)
		if err != nil {
			return false, err
		}
		log.Infof(context.TODO(), "collecting source: %s", collectUrl)
		resourceCollected, err := c.GetSource(context.TODO(), &collectorpb.GetSourceRequest{
			Url:    collectUrl,
			Format: document.Metadata.Format,
			Parser: s.Spec.Source.Parser})
		if err != nil {
			log.Errorf("error collecting source, error: %v", err)
		}
		log.Infof(context.TODO(), "resourceCollected:info:%+v", resourceCollected)
		break
	}
	return true, nil
}
func ( m * Manager ) Collect ( s * watcherpb . WatcherDetails ) ( bool , error ) { config := & tls . Config { } conn , err := grpc . Dial ( " " , grpc . WithTransportCredentials ( credentials . NewTLS ( config ) ) ) if err != nil { log . Errorf ( " " , err ) } defer conn . Close ( ) c := collectorpb . NewCollectorServiceClient ( conn ) for _ , docs := range m . index . GetEntries ( ) . GetDocuments ( ) { document := docs . GetDocument ( ) [ 0 ] collectUrl , err := getUrl ( document ) if err != nil { return false , err } log . Infof ( context . TODO ( ) , " " , collectUrl ) resourceCollected , err := c . GetSource ( context . TODO ( ) , & collectorpb . GetSourceRequest { Url : collectUrl , Format : document . Metadata . Format , Parser : s . Spec . Source . Parser } ) if err != nil { log . Errorf ( " " , err ) } log . Infof ( context . TODO ( ) , " " , resourceCollected ) break } return true , nil }
Collect will fetch all documents found missing for the given syncronisation process
Collect will fetch all documents found missing for the given syncronisation process
// Client