files

package
v0.0.0-...-4214274 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package files is generated by Handlergenerator tooling Make sure to insert real Description here

Package files is generated by Handlergenerator tooling Make sure to insert real Description here

Package files is generated by Handlergenerator tooling This Handler is used to print Payloads onto a file

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrBadWriteData is thrown when the size written to file is not the same as the payload
	ErrBadWriteData error = errors.New("the size written to file does not match the payload")
	//ErrFileExists is when trying to write to Files that already exist, but Append is set to false
	ErrFileExists = errors.New("trying to write to file that already exists, but append is false")
)
View Source
var (
	// DefaultBufferTime is how long in seconds a file should be fulfillremembered
	DefaultBufferTime int64 = 3600
)

Functions

func NewListDirectoryHandler

func NewListDirectoryHandler() handlers.Handler

NewListDirectoryHandler generates a new ListDirectory Handler

func NewReadFileHandler

func NewReadFileHandler() handlers.Handler

NewReadFileHandler generates a new ReadFile Handler

func NewWriteFileHandler

func NewWriteFileHandler() handlers.Handler

NewWriteFileHandler generates a new WriteFile Handler

Types

type ListDirectory

type ListDirectory struct {
	// Cfg is values needed to properly run the Handle func
	Cfg  *property.Configuration `json:"configs" yaml:"configs"`
	Name string                  `json:"handler" yaml:"handler_name"`

	sync.Mutex `json:"-" yaml:"-"`

	// MetricPayloadOut is how many payloads the processor has outputted
	MetricPayloadOut string
	// MetricPayloadIn is how many payloads the processor has inputted
	MetricPayloadIn string
	// contains filtered or unexported fields
}

ListDirectory is used to list all FILES in a given path

func (*ListDirectory) GetConfiguration

func (a *ListDirectory) GetConfiguration() *property.Configuration

GetConfiguration will return the CFG for the Handler

func (*ListDirectory) GetErrorChannel

func (a *ListDirectory) GetErrorChannel() chan error

GetErrorChannel will return a channel that the Handler can output eventual errors onto

func (*ListDirectory) GetHandlerName

func (a *ListDirectory) GetHandlerName() string

GetHandlerName is used to retrun a unqiue string name

func (*ListDirectory) Handle

func (a *ListDirectory) Handle(ctx context.Context, p payload.Payload, topics ...string) error

Handle is used to list all files in a direcory

func (*ListDirectory) ListDirectory

func (a *ListDirectory) ListDirectory() ([]payload.Payload, error)

ListDirectory will do all the main work, list directory or return error

func (*ListDirectory) SetMetricProvider

func (a *ListDirectory) SetMetricProvider(p metric.Provider, prefix string) error

SetMetricProvider is used to change what metrics provider is used by the handler

func (*ListDirectory) Subscriptionless

func (a *ListDirectory) Subscriptionless() bool

Subscriptionless is used to send out true

func (*ListDirectory) ValidateConfiguration

func (a *ListDirectory) ValidateConfiguration() (bool, []string)

ValidateConfiguration is used to see that all needed configurations are assigned before starting

type ReadFile

type ReadFile struct {
	// Cfg is values needed to properly run the Handle func
	Cfg  *property.Configuration `json:"configs" yaml:"configs"`
	Name string                  `json:"handler" yaml:"handler_name"`

	// MetricPayloadOut is how many payloads the processor has outputted
	MetricPayloadOut string
	// MetricPayloadIn is how many payloads the processor has inputted
	MetricPayloadIn string
	// contains filtered or unexported fields
}

ReadFile is used to ReadFiles data

func (*ReadFile) GetConfiguration

func (a *ReadFile) GetConfiguration() *property.Configuration

GetConfiguration will return the CFG for the Handler

func (*ReadFile) GetErrorChannel

func (a *ReadFile) GetErrorChannel() chan error

GetErrorChannel will return a channel that the Handler can output eventual errors onto

func (*ReadFile) GetHandlerName

func (a *ReadFile) GetHandlerName() string

GetHandlerName is used to retrun a unqiue string name

func (*ReadFile) Handle

func (a *ReadFile) Handle(ctx context.Context, input payload.Payload, topics ...string) error

Handle is used to Read the content of a file from the former payload Expects a filepath in the input payload

func (*ReadFile) SetMetricProvider

func (a *ReadFile) SetMetricProvider(p metric.Provider, prefix string) error

SetMetricProvider is used to change what metrics provider is used by the handler

func (*ReadFile) Subscriptionless

func (a *ReadFile) Subscriptionless() bool

Subscriptionless will return true/false if the Handler is genereating payloads itself

func (*ReadFile) ValidateConfiguration

func (a *ReadFile) ValidateConfiguration() (bool, []string)

ValidateConfiguration is used to see that all needed configurations are assigned before starting

type WriteFile

type WriteFile struct {
	// Cfg is values needed to properly run the Handle func
	Cfg  *property.Configuration `json:"configs" yaml:"configs"`
	Name string                  `json:"name" yaml:"handler_name"`

	// MetricPayloadOut is how many payloads the processor has outputted
	MetricPayloadOut string
	// MetricPayloadIn is how many payloads the processor has inputted
	MetricPayloadIn string
	// contains filtered or unexported fields
}

WriteFile is used to will print the stringified version of GetPayload into a file

func (*WriteFile) GetConfiguration

func (a *WriteFile) GetConfiguration() *property.Configuration

GetConfiguration will return the CFG for the Handler

func (*WriteFile) GetErrorChannel

func (a *WriteFile) GetErrorChannel() chan error

GetErrorChannel will return a channel that the Handler can output eventual errors onto

func (*WriteFile) GetHandlerName

func (a *WriteFile) GetHandlerName() string

GetHandlerName is used to retrun a unqiue string name

func (*WriteFile) Handle

func (a *WriteFile) Handle(ctx context.Context, input payload.Payload, topics ...string) error

Handle is used to write files to disc

func (*WriteFile) SetMetricProvider

func (a *WriteFile) SetMetricProvider(p metric.Provider, prefix string) error

SetMetricProvider is used to change what metrics provider is used by the handler

func (*WriteFile) Subscriptionless

func (a *WriteFile) Subscriptionless() bool

Subscriptionless will return true/false if the Handler is genereating payloads itself

func (*WriteFile) ValidateConfiguration

func (a *WriteFile) ValidateConfiguration() (bool, []string)

ValidateConfiguration is used to see that all needed configurations are assigned before starting

Jump to

Keyboard shortcuts

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