Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for SendFromStore (0.12 sec)

  1. internal/store/store.go

    var ErrNotConnected = errors.New("not connected to target server/service")
    
    // Target - store target interface
    type Target interface {
    	Name() string
    	SendFromStore(key Key) error
    }
    
    // Store - Used to persist items.
    type Store[I any] interface {
    	Put(item I) (Key, error)
    	PutMultiple(item []I) (Key, error)
    	Get(key Key) (I, error)
    	GetMultiple(key Key) ([]I, error)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  2. internal/event/target/nsq.go

    	if err != nil {
    		return err
    	}
    
    	return target.producer.Publish(target.args.Topic, data)
    }
    
    // SendFromStore - reads an event from store and sends it to NSQ.
    func (target *NSQTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	_, err := target.isActive()
    	if err != nil {
    		return err
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  3. internal/event/targetlist_test.go

    		panic(err)
    	}
    
    	time.Sleep(time.Duration(b[0]) * time.Millisecond)
    
    	if target.sendErr {
    		return errors.New("send error")
    	}
    
    	return nil
    }
    
    // SendFromStore - interface compatible method does no-op.
    func (target *ExampleTarget) SendFromStore(_ store.Key) error {
    	return nil
    }
    
    func (target ExampleTarget) Close() error {
    	if target.closeErr {
    		return errors.New("close error")
    	}
    
    	return nil
    }
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Dec 05 10:16:33 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  4. internal/event/target/webhook.go

    	}
    	return fmt.Errorf("%s returned '%s', please check your endpoint configuration", target.args.Endpoint, resp.Status)
    }
    
    // SendFromStore - reads an event from store and sends it to webhook.
    func (target *WebhookTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	eventData, eErr := target.store.Get(key)
    	if eErr != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  5. internal/event/target/mqtt.go

    	if !token.WaitTimeout(reconnectInterval) {
    		return store.ErrNotConnected
    	}
    	return token.Error()
    }
    
    // SendFromStore - reads an event from store and sends it to MQTT.
    func (target *MQTTTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	// Do not send if the connection is not active.
    	_, err := target.isActive()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  6. internal/event/target/kafka.go

    		if err != nil {
    			return err
    		}
    		msgs = append(msgs, msg)
    	}
    	return target.producer.SendMessages(msgs)
    }
    
    // SendFromStore - reads an event from store and sends it to Kafka.
    func (target *KafkaTarget) SendFromStore(key store.Key) (err error) {
    	if err = target.init(); err != nil {
    		return err
    	}
    	switch {
    	case key.ItemCount == 1:
    		var event event.Event
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  7. internal/event/target/redis.go

    			return err
    		}
    		if _, err := conn.Do("RPUSH", target.args.Key, data); err != nil {
    			return err
    		}
    	}
    
    	return nil
    }
    
    // SendFromStore - reads an event from store and sends it to redis.
    func (target *RedisTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	conn := target.pool.Get()
    	defer conn.Close()
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  8. internal/event/target/postgresql.go

    			return err
    		}
    
    		if _, err = target.insertStmt.Exec(eventTime, data); err != nil {
    			return err
    		}
    	}
    
    	return nil
    }
    
    // SendFromStore - reads an event from store and sends it to PostgreSQL.
    func (target *PostgreSQLTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	_, err := target.isActive()
    	if err != nil {
    		return err
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  9. internal/event/target/amqp.go

    	ch, confirms, err := target.channel()
    	if err != nil {
    		return err
    	}
    	defer ch.Close()
    
    	return target.send(eventData, ch, confirms)
    }
    
    // SendFromStore - reads an event from store and sends it to AMQP091.
    func (target *AMQPTarget) SendFromStore(key store.Key) error {
    	if err := target.init(); err != nil {
    		return err
    	}
    
    	ch, confirms, err := target.channel()
    	if err != nil {
    		return err
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 10K bytes
    - Viewed (0)
  10. internal/logger/target/kafka/kafka.go

    		atomic.AddInt64(&h.totalMessages, 1)
    		atomic.AddInt64(&h.failedMessages, 1)
    		return errors.New("log buffer full")
    	}
    	return nil
    }
    
    // SendFromStore - reads the log from store and sends it to kafka.
    func (h *Target) SendFromStore(key store.Key) (err error) {
    	auditEntry, err := h.store.Get(key)
    	if err != nil {
    		if os.IsNotExist(err) {
    			return nil
    		}
    		return err
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top