input

package
v0.1.3-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindFile = "file"
	KindHttp = "http"
)

Variables

View Source
var (
	ErrInvalidInput = errors.New("invalid input config")
)
View Source
var (
	ErrMissingChannel = errors.New("input cfg is missing channel")
)

Functions

This section is empty.

Types

type ChannelInput

type ChannelInput struct {
	Input <-chan *optimusv1.LogEvent
	// contains filtered or unexported fields
}

func (*ChannelInput) Initialize

func (ci *ChannelInput) Initialize(id string, broker pubsub.Broker) error

func (*ChannelInput) Process

func (ci *ChannelInput) Process(ctx context.Context) error

type FileInput

type FileInput struct {
	Path    string `hcl:"path"`
	DataDir string `hcl:"data_dir,optional"`
	// contains filtered or unexported fields
}

func NewFileInput

func NewFileInput(path, dataDir string) *FileInput

func (*FileInput) Initialize

func (fi *FileInput) Initialize(id string, broker pubsub.Broker) error

func (*FileInput) Process

func (fi *FileInput) Process(ctx context.Context) error

type HTTPInput

type HTTPInput struct {
}

func (*HTTPInput) Initialize

func (hi *HTTPInput) Initialize(id string, broker pubsub.Broker) error

func (*HTTPInput) Process

func (hi *HTTPInput) Process(ctx context.Context) error

type Input

type Input struct {
	Kind string   `hcl:"kind,label"`
	ID   string   `hcl:"id,label"`
	Body hcl.Body `hcl:",remain"`

	Broker pubsub.Broker
	// contains filtered or unexported fields
}

func New

func New(id, kind string, internal InputProcessor) (*Input, error)

func (*Input) Init

func (in *Input) Init() error

func (*Input) Process

func (i *Input) Process(ctx context.Context) (err error)

type InputProcessor

type InputProcessor interface {
	Initialize(id string, broker pubsub.Broker) error
	Process(context.Context) error
}

func HclImpl

func HclImpl(kind string, ctx *hcl.EvalContext, body hcl.Body) (InputProcessor, hcl.Diagnostics)

Jump to

Keyboard shortcuts

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