cassandra

package
v0.0.0-...-d6856c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpCassandra

func DumpCassandra(cfg Config) (*services.EventList, error)

DumpCassandra load all existing cassandra data.

func ReadCassandraDump

func ReadCassandraDump(inFile string) (*services.EventList, error)

ReadCassandraDump reads json dump of cassandra.

Types

type AmqpConfig

type AmqpConfig struct {
	// contains filtered or unexported fields
}

AmqpConfig groups config fields for AMQP

type AmqpEventProcessor

type AmqpEventProcessor struct {
	// contains filtered or unexported fields
}

AmqpEventProcessor implements EventProcessor

func NewAmqpEventProcessor

func NewAmqpEventProcessor() *AmqpEventProcessor

NewAmqpEventProcessor return Amqp event processor

func (*AmqpEventProcessor) Process

func (p *AmqpEventProcessor) Process(ctx context.Context, event *services.Event) (*services.Event, error)

Process sends msg to amqp exchange

type AmqpMessage

type AmqpMessage struct {
	RequestID string          `json:"request_id"`
	Oper      string          `json:"oper"`
	Type      string          `json:"type"`
	UUID      string          `json:"uuid"`
	FqName    []string        `json:"fq_name"`
	Data      json.RawMessage `json:"obj_dict"`
}

AmqpMessage type

type Config

type Config struct {
	Host           string
	Port           int
	Timeout        time.Duration
	ConnectTimeout time.Duration
}

Config fields for cassandra

func GetConfig

func GetConfig() Config

GetConfig returns cassandra Config filled with data from config file.

type EventProcessor

type EventProcessor struct {
	// contains filtered or unexported fields
}

EventProcessor writes events to cassandra and implements service.EventProcessor interface

func NewEventProcessor

func NewEventProcessor() *EventProcessor

NewEventProcessor returns new cassandra.EventProcessor

func (*EventProcessor) Process

func (p *EventProcessor) Process(ctx context.Context, event *services.Event) (*services.Event, error)

Process is a method needed to implement service.EventProcessor interface

type EventProducer

type EventProducer struct {
	Processor services.EventProcessor
	// contains filtered or unexported fields
}

EventProducer send db update for processor. Event will be harvest from cassandra db and from amqp later on.

func NewEventProducer

func NewEventProducer(
	processor services.EventProcessor,
) *EventProducer

NewEventProducer makes event producer and couple it with processor given.

func (*EventProducer) Start

func (p *EventProducer) Start(ctx context.Context) error

Start starts event processor for cassandra.

func (*EventProducer) WatchAMQP

func (p *EventProducer) WatchAMQP(ctx context.Context) error

WatchAMQP watches AMQP. nolint: gocyclo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL