input

package
v0.0.0-...-2e804f1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupInputs

func SetupInputs(s state.State, inputsConf *koanf.Koanf, inputPubSub *PubSub)

Types

type Input

type Input interface {
	Provide() chan dnszilla.DNSResult
}

func NewKafka

func NewKafka(s state.State, c *Kafka) (Input, error)

func NewStdinInput

func NewStdinInput(ctx context.Context, logger *zerolog.Logger, format string) Input

type Kafka

type Kafka struct {
	Name       string
	Format     string   // example: jsonl, gob
	Endpoints  []string // example: localhost:9092
	Topic      string   // example: test
	Partition  int
	Offset     int64
	SSL        bool
	CAPath     string
	ClientCert string
	ClientKey  string
	Timeout    time.Duration
}

Kafka provides the main Kafka struct and functionality

type PubSub

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

func NewPubSub

func NewPubSub(s state.State) *PubSub

New creates a new PubSub instance

func (*PubSub) Pub

func (p *PubSub) Pub(pub chan dnszilla.DNSResult, name string)

Pub takes an input chan and name and publishes it

func (*PubSub) PubCount

func (p *PubSub) PubCount() int

func (*PubSub) Sub

func (p *PubSub) Sub(names ...string) chan dnszilla.DNSResult

Sub takes a list of publisher names and subscribes to them

func (*PubSub) SubCount

func (p *PubSub) SubCount() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳