input

package
v0.0.0-...-5849f30 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartInput

func StartInput(in Source, inChan *chan interface{}) error

Types

type CertStreamInput

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

CertStreamInput provides a stream of Certificate Transparency Logs https://www.certificate-transparency.org/ It's used for example purposes only and should NOT be used in production Since the stream is a websocket slow processing would result in memory pressure Instead the data should be pushed into a queue, such as Kinesis, and GoFish should read from that stream

func (*CertStreamInput) Close

func (c *CertStreamInput) Close() error

Close closes the input stream

func (*CertStreamInput) Init

func (c *CertStreamInput) Init(...interface{}) error

Init initialises the input stream

func (*CertStreamInput) Retrieve

func (c *CertStreamInput) Retrieve(output *chan interface{})

Retrieve starts the input retrieval

type DefaultSource

type DefaultSource struct{}

DefaultSource is an implementation of the SourceIface used to create inputs

func (*DefaultSource) Create

func (*DefaultSource) Create(config SourceConfig) (Source, error)

type FileConfig

type FileConfig struct {
	Path string `json:"path"`
}

type FileInput

type FileInput struct {
	FileName string
}

func (*FileInput) Close

func (i *FileInput) Close() error

func (*FileInput) Init

func (i *FileInput) Init(...interface{}) error

func (*FileInput) Retrieve

func (i *FileInput) Retrieve(output *chan interface{})

type KafkaConfig

type KafkaConfig struct {
	Broker     string `json:"broker"`
	Topic      string `json:"topic"`
	Partitions int32  `json:"partitions"`
}

type KafkaInput

type KafkaInput struct {
	Broker     string
	Topic      string
	Partitions int32
	// contains filtered or unexported fields
}

func (*KafkaInput) Close

func (k *KafkaInput) Close() error

func (*KafkaInput) Init

func (k *KafkaInput) Init(...interface{}) error

func (*KafkaInput) Retrieve

func (k *KafkaInput) Retrieve(output *chan interface{})

type KinesisConfig

type KinesisConfig struct {
	StreamName string `json:"streamName"`
}

type KinesisInput

type KinesisInput struct {
	StreamName string
	// contains filtered or unexported fields
}

KinesisInput implements the Input interface

func (*KinesisInput) Close

func (ki *KinesisInput) Close() error

func (*KinesisInput) Init

func (ki *KinesisInput) Init(...interface{}) error

Init implements initialises the Input mechanism

func (*KinesisInput) Retrieve

func (ki *KinesisInput) Retrieve(output *chan interface{})

Retrieve implements the Input interface

type Source

type Source interface {
	Retrieve(*chan interface{})
	Init(...interface{}) error
	Close() error
}

Source is an interface for input implemenations

type SourceConfig

type SourceConfig struct {
	Type          string        `json:"type"`
	FileConfig    FileConfig    `json:"file_config,omitempty"`
	KinesisConfig KinesisConfig `json:"kinesis_config,omitempty"`
	KafkaConfig   KafkaConfig   `json:"kafka_config,omitempty"`
}

type SourceIface

type SourceIface interface {
	Create(config SourceConfig) (Source, error)
}

SourceIface provides an interface for creating input sources

Jump to

Keyboard shortcuts

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