file

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NumberOfFailWriteMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "file_output",
	Name:      "number_messages_writes_fail_total",
	Help:      "Number of failed message writes to file output",
}, []string{"file_name", "reason"})
View Source
var NumberOfReceivedMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "file_output",
	Name:      "number_messages_received_total",
	Help:      "Number of messages received by file output",
}, []string{"file_name"})
View Source
var NumberOfWrittenBytes = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "file_output",
	Name:      "number_bytes_written_total",
	Help:      "Number of bytes written to file output",
}, []string{"file_name"})
View Source
var NumberOfWrittenMsgs = prometheus.NewCounterVec(prometheus.CounterOpts{
	Namespace: "gnmic",
	Subsystem: "file_output",
	Name:      "number_messages_writes_total",
	Help:      "Number of messages written to file output",
}, []string{"file_name"})

Functions

This section is empty.

Types

type Config

type Config struct {
	FileName           string   `mapstructure:"filename,omitempty"`
	FileType           string   `mapstructure:"file-type,omitempty"`
	Format             string   `mapstructure:"format,omitempty"`
	Multiline          bool     `mapstructure:"multiline,omitempty"`
	Indent             string   `mapstructure:"indent,omitempty"`
	Separator          string   `mapstructure:"separator,omitempty"`
	OverrideTimestamps bool     `mapstructure:"override-timestamps,omitempty"`
	AddTarget          string   `mapstructure:"add-target,omitempty"`
	TargetTemplate     string   `mapstructure:"target-template,omitempty"`
	EventProcessors    []string `mapstructure:"event-processors,omitempty"`
	MsgTemplate        string   `mapstructure:"msg-template,omitempty"`
	ConcurrencyLimit   int      `mapstructure:"concurrency-limit,omitempty"`
	EnableMetrics      bool     `mapstructure:"enable-metrics,omitempty"`
	Debug              bool     `mapstructure:"debug,omitempty"`
}

Config //

type File

type File struct {
	Cfg *Config
	// contains filtered or unexported fields
}

File //

func (*File) Close

func (f *File) Close() error

Close //

func (*File) Init

func (f *File) Init(ctx context.Context, name string, cfg map[string]interface{}, opts ...outputs.Option) error

Init //

func (*File) RegisterMetrics added in v0.7.0

func (f *File) RegisterMetrics(reg *prometheus.Registry)

Metrics //

func (*File) SetClusterName added in v0.8.0

func (f *File) SetClusterName(name string)

func (*File) SetEventProcessors added in v0.6.0

func (f *File) SetEventProcessors(ps map[string]map[string]interface{},
	logger *log.Logger,
	tcs map[string]*types.TargetConfig,
	acts map[string]map[string]interface{})

func (*File) SetLogger added in v0.5.2

func (f *File) SetLogger(logger *log.Logger)

func (*File) SetName added in v0.7.0

func (f *File) SetName(name string)

func (*File) SetTargetsConfig added in v0.18.0

func (f *File) SetTargetsConfig(map[string]*types.TargetConfig)

func (*File) String

func (f *File) String() string

func (*File) Write

func (f *File) Write(ctx context.Context, rsp proto.Message, meta outputs.Meta)

Write //

func (*File) WriteEvent added in v0.7.0

func (f *File) WriteEvent(ctx context.Context, ev *formatters.EventMsg)

Jump to

Keyboard shortcuts

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