Documentation
¶
Overview ¶
Package filebatch writes a batch of evaluation events to a file: the file name from a template, and the content in JSON lines, CSV or Parquet. The file exporter writes the file where it is wanted; the exporters of the object stores (S3, Google Cloud Storage, Azure Blob Storage) write it to a temporary directory and upload it. The package is theirs to share: no exporter imports another.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// Format is the output format you want in your exported file.
// Available format are JSON, CSV, and Parquet.
// Default: JSON
Format string
// OutputDir is the location of the directory where to store the exported files
// Default: the current directory
OutputDir string
// Filename is the name of your output file
// You can use a templated config to define the name of your export files.
// Available replacement are {{ .Hostname}}, {{ .Timestamp}} and {{ .Format}}.
// {{ .Timestamp}} is the milliseconds since the epoch followed by 12 random digits. Two exports in the
// same millisecond get the same name with a chance of about 1 in 10^12 (see exporter.ComputeFilename).
// Default: "flag-variation-{{ .Hostname}}-{{ .Timestamp}}.{{ .Format}}"
Filename string
// CsvTemplate is used if your output format is CSV.
// This field will be ignored if you are using another format than CSV.
// You can decide which fields you want in your CSV line with a go-template syntax,
// please check exporter/feature_event.go to see what are the fields available.
// Default:
// {{ .Kind}};{{ .ContextKind}};{{ .UserKey}};{{ .CreationDate}};{{ .Key}};{{ .Variation}};{{ .Value}};
// {{ .Default}};{{ .Source}}\n
CsvTemplate string
// ParquetCompressionCodec is the parquet compression codec for better space efficiency.
// Available options https://github.com/apache/parquet-format/blob/master/Compression.md
// Default: SNAPPY
ParquetCompressionCodec string
// contains filtered or unexported fields
}
Writer writes a batch of evaluation events to one file of a directory in the format of its fields: the part of the file exporter that the exporters of the object stores share (they write the batch to a temporary directory and upload the file). The zero value is ready to use and not safe for concurrent use.