Documentation ¶
Index ¶
- Constants
- Variables
- func Name(props property.Properties) string
- func ValidateSection(kind SectionKind, props property.Properties) error
- func ValidateSectionWithSchema(kind SectionKind, props property.Properties, schema Schema) error
- type ByName
- type Config
- func (c *Config) AddSection(kind SectionKind, props property.Properties)
- func (c Config) DumpAs(format Format) (string, error)
- func (c Config) DumpAsClassic() (string, error)
- func (c Config) DumpAsJSON() (string, error)
- func (c Config) DumpAsYAML() (string, error)
- func (c Config) Equal(target Config) bool
- func (c *Config) Include(path string)
- func (c Config) MarshalClassic() ([]byte, error)
- func (c *Config) SetEnv(key string, value any)
- func (c *Config) UnmarshalClassic(text []byte) error
- func (c Config) Validate() error
- func (c Config) ValidateWithSchema(schema Schema) error
- type Format
- type LinedError
- type Pipeline
- type Schema
- type SchemaFluentBit
- type SchemaOptions
- type SchemaProperties
- type SchemaSection
- type SectionKind
Constants ¶
View Source
const ( FormatClassic = "classic" FormatYAML = "yaml" FormatJSON = "json" )
Variables ¶
View Source
var DefaultSchema = func() Schema { var s Schema err := json.Unmarshal(rawSchema, &s) if err != nil { fmt.Fprintf(os.Stderr, "could not parse fluent-bit schema: %v\n", err) os.Exit(1) } s.InjectLTSPlugins() return s }()
View Source
var ErrFormatUnknown = errors.New("format unknown")
View Source
var ErrMissingName = errors.New("missing name property")
Functions ¶
func ValidateSection ¶ added in v0.7.1
func ValidateSection(kind SectionKind, props property.Properties) error
func ValidateSectionWithSchema ¶ added in v0.7.1
func ValidateSectionWithSchema(kind SectionKind, props property.Properties, schema Schema) error
Types ¶
type ByName ¶ added in v0.7.0
type ByName map[string]property.Properties
type Config ¶
type Config struct { Env property.Properties `json:"env,omitempty" yaml:"env,omitempty"` Includes []string `json:"includes,omitempty" yaml:"includes,omitempty"` Service property.Properties `json:"service,omitempty" yaml:"service,omitempty"` Customs []ByName `json:"customs,omitempty" yaml:"customs,omitempty"` Pipeline Pipeline `json:"pipeline,omitempty" yaml:"pipeline,omitempty"` }
func (*Config) AddSection ¶ added in v0.7.1
func (c *Config) AddSection(kind SectionKind, props property.Properties)
func (Config) DumpAsClassic ¶ added in v0.7.1
func (Config) DumpAsJSON ¶ added in v0.7.1
func (Config) DumpAsYAML ¶ added in v0.7.1
func (Config) MarshalClassic ¶ added in v0.7.1
func (*Config) UnmarshalClassic ¶ added in v0.7.1
func (Config) ValidateWithSchema ¶ added in v0.2.0
ValidateWithSchema validates that the config satisfies all properties defined on the schema. That is if the schema says the the input plugin "cpu" has a property named "pid" that is of integer type, it must be a valid integer.
type LinedError ¶ added in v0.7.1
LinedError with information about the line number where the error was found while parsing.
func NewLinedError ¶ added in v0.7.1
func NewLinedError(msg string, line uint) *LinedError
func WrapLinedError ¶ added in v0.7.1
func WrapLinedError(err error, line uint) *LinedError
func (*LinedError) Error ¶ added in v0.7.1
func (e *LinedError) Error() string
type Schema ¶ added in v0.2.0
type Schema struct { FluentBit SchemaFluentBit `json:"fluent-bit"` Customs []SchemaSection `json:"customs"` Inputs []SchemaSection `json:"inputs"` Filters []SchemaSection `json:"filters"` Outputs []SchemaSection `json:"outputs"` }
func (*Schema) InjectLTSPlugins ¶ added in v0.2.1
func (s *Schema) InjectLTSPlugins()
type SchemaFluentBit ¶ added in v0.2.0
type SchemaOptions ¶ added in v0.2.0
type SchemaProperties ¶ added in v0.2.0
type SchemaProperties struct { Options []SchemaOptions `json:"options"` // Networking is only present in outputs. Networking []SchemaOptions `json:"networking"` // NetworkTLS is only present in outputs. NetworkTLS []SchemaOptions `json:"network_tls"` }
type SchemaSection ¶ added in v0.2.0
type SchemaSection struct { Type string `json:"type"` Name string `json:"name"` Description string `json:"description"` Properties SchemaProperties `json:"properties"` }
type SectionKind ¶ added in v0.7.1
type SectionKind string
const ( SectionKindService SectionKind = "service" SectionKindCustom SectionKind = "custom" SectionKindInput SectionKind = "input" SectionKindParser SectionKind = "parser" SectionKindFilter SectionKind = "filter" SectionKindOutput SectionKind = "output" )
func (SectionKind) String ¶ added in v0.7.1
func (k SectionKind) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.