yaml

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventChecker

type EventChecker struct {
	eventchecker.EventChecker
}

EventChecker is a wrapper around the EventChecker interface to help unmarshaling

func (EventChecker) MarshalJSON

func (checker EventChecker) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*EventChecker) UnmarshalJSON

func (checker *EventChecker) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

type EventCheckerConf

type EventCheckerConf struct {
	APIVersion string                `json:"apiVersion"`
	Kind       string                `json:"kind"`
	Metadata   Metadata              `json:"metadata"`
	Spec       MultiEventCheckerSpec `json:"spec"`
}

Metadata contains metadata for the eventchecker definition

func ConfFromChecker

func ConfFromChecker(apiVersion, name, description string,
	checker eventchecker.MultiEventChecker) (*EventCheckerConf, error)

ConfFromChecker creates a new EventCheckerConf from a MultiEventChecker

func ConfFromSpec

func ConfFromSpec(apiVersion, name, description string,
	spec *MultiEventCheckerSpec) (*EventCheckerConf, error)

ConfFromSpec creates a new EventCheckerConf from a MultiEventCheckerSpec

func ReadYaml

func ReadYaml(data string) (*EventCheckerConf, error)

ReadYaml reads an event checker from yaml

func ReadYamlFile

func ReadYamlFile(file string) (*EventCheckerConf, error)

ReadYamlFile reads an event checker from a yaml file

func ReadYamlFileTemplate

func ReadYamlFileTemplate(file string, data interface{}) (*EventCheckerConf, error)

ReadYamlFileTemplate reads an event checker template from yaml

func ReadYamlTemplate

func ReadYamlTemplate(text string, data interface{}) (*EventCheckerConf, error)

ReadYamlTemplate reads an event checker template from yaml

func (*EventCheckerConf) WriteYaml

func (conf *EventCheckerConf) WriteYaml() (string, error)

WriteYaml writes an event checker to yaml

func (*EventCheckerConf) WriteYamlFile

func (conf *EventCheckerConf) WriteYamlFile(file string) error

WriteYamlFile writes an event checker to a yaml file

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

Metadata contains metadata for the eventchecker definition

type MultiEventCheckerSpec

type MultiEventCheckerSpec struct {
	Ordered bool           `json:"ordered"`
	Checks  []EventChecker `json:"checks"`
}

MultiEventCheckerSpec is a YAML spec to define a MultiEventChecker

func SpecFromMultiEventChecker

func SpecFromMultiEventChecker(checker_ eventchecker.MultiEventChecker) (*MultiEventCheckerSpec, error)

SpecFromMultiEventChecker coerces a spec from a MultiEventChecker

func (*MultiEventCheckerSpec) IntoMultiEventChecker

func (spec *MultiEventCheckerSpec) IntoMultiEventChecker() (eventchecker.MultiEventChecker, error)

IntoMultiEventChecker coerces an event checker from this spec

Jump to

Keyboard shortcuts

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