KubFly SDK for Go / output/bucket/config
package config
import "kubfly.io/sdk/output/bucket/config"
Package config holds the variables of the output of a bucket and their defaults — the only place of the defaults (the rule of the SDK): code takes the values from bucket.Config. It is io.kubfly.sdk.output.bucket.config of the Java SDK: the names of the variables are the same. The lanes, the window and the limits of the encoder are of the pipeline (kubfly.io/sdk/pipeline/config).
Constants
const ( // Bucket is the switch of the collector: ON, OFF or AUTO (by default — on when KUBFLY_OUTPUT_BUCKET_KIND is // set). Bucket = "KUBFLY_OUTPUT_BUCKET" // EventsFlush is the interval of the segments of events, seconds. EventsFlush = "KUBFLY_OUTPUT_BUCKET_EVENTS_FLUSH" // DefaultEventsFlush is the interval of the segments of events by default, seconds. DefaultEventsFlush = 60 // MetricsFlush is the interval of the segments of metrics, seconds. MetricsFlush = "KUBFLY_OUTPUT_BUCKET_METRICS_FLUSH" // AlertsFlush is the interval of the segments of alerts, seconds. AlertsFlush = "KUBFLY_OUTPUT_BUCKET_ALERTS_FLUSH" // HealthFlush is the interval of the segments of health, seconds. HealthFlush = "KUBFLY_OUTPUT_BUCKET_HEALTH_FLUSH" // TrafficFlush is the interval of the segments of traffic, seconds. TrafficFlush = "KUBFLY_OUTPUT_BUCKET_TRAFFIC_FLUSH" // ProfilesFlush is the interval of the segments of profiles, seconds. ProfilesFlush = "KUBFLY_OUTPUT_BUCKET_PROFILES_FLUSH" // TracksFlush is the interval of the segments of tracks, seconds. TracksFlush = "KUBFLY_OUTPUT_BUCKET_TRACKS_FLUSH" // TrafficEncrypt tells whether the stream traffic is encrypted, as events and metrics, when the keys of the // recipients are set (on, by default), or open, as alerts (off). TrafficEncrypt = "KUBFLY_OUTPUT_BUCKET_TRAFFIC_ENCRYPT" // DefaultFlush is the interval of the segments of metrics, alerts, health, traffic, profiles and tracks by // default, seconds. DefaultFlush = 60 // Spool is the directory of the spool: segments that the bucket did not take; unset — no spool. Spool = "KUBFLY_OUTPUT_BUCKET_SPOOL" // SpoolBytes is the most bytes of the spool. SpoolBytes = "KUBFLY_OUTPUT_BUCKET_SPOOL_BYTES" // DefaultSpoolBytes is the limit of the spool by default: 1 GiB. DefaultSpoolBytes = int64(1) << 30 // SpoolFiles is the most segments in the spool. SpoolFiles = "KUBFLY_OUTPUT_BUCKET_SPOOL_FILES" // AttachmentBytes is the buffer of the attachments (format.md §10d): two halves, each a pack put by one request; // the largest attachment is a half. AttachmentBytes = "KUBFLY_OUTPUT_BUCKET_ATTACHMENT_BYTES" // DefaultAttachmentBytes is the buffer of the attachments by default: 32 MiB, two halves of 16 MiB. DefaultAttachmentBytes = int64(32) << 20 // DefaultSpoolFiles is the limit of segments in the spool by default. DefaultSpoolFiles = 10_000 // BlockSize is the size of a block, uncompressed, bytes. BlockSize = "KUBFLY_OUTPUT_BUCKET_BLOCK_SIZE" // DefaultBlockSize is the size of a block by default: 1 MiB. DefaultBlockSize = 1_048_576 // SegmentBlocks is the size of a segment, blocks. SegmentBlocks = "KUBFLY_OUTPUT_BUCKET_SEGMENT_BLOCKS" // DefaultSegmentBlocks is the size of a segment by default, blocks. DefaultSegmentBlocks = int64(32) // DeflateLevel is the level of deflate, 1–9. DeflateLevel = "KUBFLY_OUTPUT_BUCKET_DEFLATE_LEVEL" // DefaultDeflateLevel is the level of deflate by default. DefaultDeflateLevel = 1 // Level is the most verbose level the collector takes. Level = "KUBFLY_OUTPUT_BUCKET_LEVEL" // DefaultLevel is the level by default. DefaultLevel = api.LevelInfo // EventsUrgent is the level from which an event closes its segment of events soon, not at the interval // (requirements §12.4): ERROR takes FATAL too; OFF — never. EventsUrgent = "KUBFLY_OUTPUT_BUCKET_EVENTS_URGENT" // DefaultEventsUrgent is the level of an urgent event by default. DefaultEventsUrgent = api.LevelError // AlertsUrgent tells whether a new alert closes its segment of alerts soon: on (by default) or off. AlertsUrgent = "KUBFLY_OUTPUT_BUCKET_ALERTS_URGENT" // UrgentDelay is how long after an urgent record its segment closes, milliseconds, so the records right after it // go in the same segment; by default the ordering window. UrgentDelay = "KUBFLY_OUTPUT_BUCKET_URGENT_DELAY" // UrgentInterval is the least time between two urgent closes of a stream, seconds: the guard against an // avalanche of errors. UrgentInterval = "KUBFLY_OUTPUT_BUCKET_URGENT_INTERVAL" // DefaultUrgentInterval is the least time between urgent closes by default, seconds. DefaultUrgentInterval = 5 // Keys are the public keys of the recipients: the bodies of PEM KUBFLY PUBLIC KEY (MLKEM1024-P384), // comma-separated. Keys = "KUBFLY_OUTPUT_BUCKET_KEYS" // KeysFile is a file of PEM KUBFLY PUBLIC KEY blocks (a ConfigMap): more recipients. KeysFile = "KUBFLY_OUTPUT_BUCKET_KEYS_FILE" // Code are the sources of the build — a directory, or a .zip or .jar of them: the first instance of the build // (KUBFLY_BUILD) puts its code into the bucket (format.md §10c). Code = "KUBFLY_OUTPUT_BUCKET_CODE" )
The variables of the collector, with their defaults.
Functions
func KeysOf
func KeysOf(vars map[string]string, errors *[]string) []*decoder.RecipientPublicKey
KeysOf are the public keys of the recipients, MLKEM1024-P384: KUBFLY_OUTPUT_BUCKET_KEYS and the blocks of KUBFLY_OUTPUT_BUCKET_KEYS_FILE, without repeats; none — no cipher. A key that is not one, or a file that cannot be read, is an error.
func Label
func Label(variable string, name util.Option[string], problems *[]string)
Label checks a name of the stand: required, a DNS-1123 label.
func LevelFrom
func LevelFrom(vars map[string]string, name string, fallback api.Level, problems *[]string) api.Level
LevelFrom is the level of a variable by name, or the default with a problem.
func LevelOf
func LevelOf(vars map[string]string, problems *[]string) api.Level
LevelOf is the level of KUBFLY_OUTPUT_BUCKET_LEVEL, or the default with a problem.
func PositiveLong
func PositiveLong(vars map[string]string, name string, fallback int64, problems *[]string) int64
PositiveLong is a positive integer of 64 bits, or the default with a problem.