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 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) FindByID(id string) (Plugin, bool)
- func (c Config) IDs(namespaced bool) []string
- func (c *Config) Include(path string)
- func (c Config) MarshalClassic() ([]byte, error)
- func (c *Config) ServicePorts() ServicePorts
- 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 Plugin
- type Plugins
- type Schema
- type SchemaFluentBit
- type SchemaOptions
- type SchemaProperties
- type SchemaSection
- type SectionKind
- type ServicePort
- type ServicePorts
- type UnknownPluginError
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 ¶
func ValidateSection(kind SectionKind, props property.Properties) error
func ValidateSectionWithSchema ¶
func ValidateSectionWithSchema(kind SectionKind, props property.Properties, schema Schema) error
Types ¶
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 Plugins `json:"customs,omitempty" yaml:"customs,omitempty"` Pipeline Pipeline `json:"pipeline,omitempty" yaml:"pipeline,omitempty"` }
func (*Config) AddSection ¶
func (c *Config) AddSection(kind SectionKind, props property.Properties)
func (Config) DumpAsClassic ¶
func (Config) DumpAsJSON ¶
func (Config) DumpAsYAML ¶
func (Config) FindByID ¶
FindByID were the id should be namespaced with the section kind and name. For example: input:tail:tail.0
func (Config) MarshalClassic ¶
func (*Config) ServicePorts ¶
func (c *Config) ServicePorts() ServicePorts
func (*Config) UnmarshalClassic ¶
func (Config) ValidateWithSchema ¶
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 ¶
LinedError with information about the line number where the error was found while parsing.
func NewLinedError ¶
func NewLinedError(msg string, line uint) *LinedError
func WrapLinedError ¶
func WrapLinedError(err error, line uint) *LinedError
func (*LinedError) Error ¶
func (e *LinedError) Error() string
type Plugin ¶
type Plugin struct { ID string `json:"-" yaml:"-"` Name string `json:"-" yaml:"-"` Properties property.Properties `json:",inline" yaml:",inline"` }
func (Plugin) MarshalJSON ¶
func (Plugin) MarshalYAML ¶
func (*Plugin) UnmarshalJSON ¶
func (*Plugin) UnmarshalYAML ¶
type Plugins ¶
type Plugins []Plugin
func (*Plugins) UnmarshalJSON ¶
func (*Plugins) UnmarshalYAML ¶
type Schema ¶
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 ¶
func (s *Schema) InjectLTSPlugins()
type SchemaFluentBit ¶
type SchemaOptions ¶
type SchemaProperties ¶
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 ¶
type SchemaSection struct { Type string `json:"type"` Name string `json:"name"` Description string `json:"description"` Properties SchemaProperties `json:"properties"` }
type SectionKind ¶
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 ¶
func (k SectionKind) String() string
type ServicePort ¶
type ServicePort struct { Port int Protocol networking.Protocol Kind SectionKind // Plugin is not available for `service“ section kind. Plugin *Plugin }
type ServicePorts ¶
type ServicePorts []ServicePort
type UnknownPluginError ¶ added in v2.1.0
type UnknownPluginError struct { Kind SectionKind Name string }
func NewUnknownPluginError ¶ added in v2.1.0
func NewUnknownPluginError(kind SectionKind, name string) *UnknownPluginError
func (*UnknownPluginError) Error ¶ added in v2.1.0
func (e *UnknownPluginError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.