report

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(format Format, r *Report, w io.Writer, l *logrus.Logger)

Write - write report based on given format

Types

type Format

type Format string

Format - type used to set supported report formats

const (
	JSON       Format = "json"
	TABBED     Format = "tabbed"
	SimpleText Format = "simple"
	MARKDOWN   Format = "markdown"
	YAML       Format = "yaml"
)

Define supported formats

type Report

type Report struct {
	APIVersion string     `json:"api_version" yaml:"api_version"`
	Timestamp  time.Time  `json:"timestamp" yaml:"timestamp"`
	Services   []*Service `json:"services" yaml:"services"`
}

func FromManifest

func FromManifest(m *manifest.Manifest) (report *Report, err error)

type Service added in v0.11.0

type Service struct {
	Dependencies  []string        `json:"-" yaml:"-"`
	ServiceLevels []*ServiceLevel `json:"service_levels" yaml:"service_levels"`
	Name          string          `json:"name" yaml:"name"`
}

type ServiceLevel

type ServiceLevel struct {
	Name      string              `json:"name" yaml:"name"`
	Type      string              `json:"type" yaml:"type"`
	Objective float64             `json:"objective" yaml:"objective"`
	Result    *ServiceLevelResult `json:"result" yaml:"result"`

	// TODO: decide whether this should be implemented as
	// Observation Windor or Boundary
	ObservationWindow Window `json:"window" yaml:"window"`
	// contains filtered or unexported fields
}

type ServiceLevelResult added in v0.11.0

type ServiceLevelResult struct {
	Actual interface{} `json:"actual"`
	Delta  interface{} `json:"delta"`
	// contains filtered or unexported fields
}

type Window

type Window struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

Jump to

Keyboard shortcuts

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