Documentation
¶
Overview ¶
Package contract defines language-neutral data contracts that can be inspected from source code and rendered into host formats such as NFlow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderNFlow ¶
RenderNFlow renders valid @schema declarations and a commented pipeline example. The commented example keeps the generated file compilable until a user adds real actions.
func ValidateAll ¶
ValidateAll checks every contract and rejects duplicate schema names.
Types ¶
type Contract ¶
type Contract struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Fields []Field `json:"fields"`
}
Contract is a named, language-neutral object shape.
type Field ¶
type Field struct {
Name string `json:"name"`
JSONName string `json:"json_name,omitempty"`
Type ValueType `json:"type"`
Required bool `json:"required"`
}
Field describes one named value in a contract. JSONName is optional and defaults to Name; Required describes whether the field must be present.
Click to show internal directories.
Click to hide internal directories.