spec

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment []string

Comment is an array of strings

func (*Comment) UnmarshalJSON

func (c *Comment) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the given byte into a Comment. Valid values are strings and arrays of strings

type Field

type Field struct {
	Comment       Comment      `json:"comment"`
	Default       string       `json:"default"`
	Index         *int         `json:"index"`
	Required      bool         `json:"required"`
	Sanitization  Sanitization `json:"sanitization"`
	TopLevelField bool         `json:"top_level_field"`
	Type          string       `json:"type"`
	URL           string       `json:"url"`
}

Field contains requirements for a log field

type Sanitization

type Sanitization struct {
	Key struct {
		Replacements []string `json:"replacements"`
		Substitute   string   `json:"substitute"`
	} `json:"key"`
}

Sanitization defines a substitute for certain substrings

type Spec

type Spec struct {
	URL string `json:"url"`
	ECS struct {
		Version string `json:"version"`
	} `json:"ecs"`
	Fields map[string]Field `json:"fields"`
}

Spec holds the fields specified for a spec version

var (
	// V1 holds the v1 specification
	V1 *Spec
)

func (*Spec) RequiredFields

func (s *Spec) RequiredFields() []string

RequiredFields returns all fields that are defined as required

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL