openslo

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package openslo defines the OpenSLO specification general definitions. These definitions are shared across all versions of the specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind represents all the object kinds defined by OpenSLO specification. Keep in mind not all specification versions support every Kind.

const (
	KindSLO                     Kind = "SLO"
	KindSLI                     Kind = "SLI"
	KindDataSource              Kind = "DataSource"
	KindService                 Kind = "Service"
	KindAlertPolicy             Kind = "AlertPolicy"
	KindAlertCondition          Kind = "AlertCondition"
	KindAlertNotificationTarget Kind = "AlertNotificationTarget"
)

func ParseKind added in v0.3.0

func ParseKind(s string) (Kind, error)

func (Kind) String

func (k Kind) String() string

func (*Kind) UnmarshalText

func (k *Kind) UnmarshalText(text []byte) error

UnmarshalText implements the text encoding.TextUnmarshaler interface.

func (Kind) Validate

func (k Kind) Validate() error

type Object

type Object interface {
	fmt.Stringer
	// GetVersion returns the API [Version] of the [Object].
	GetVersion() Version
	// GetKind returns the [Kind] of the [Object].
	GetKind() Kind
	// GetName returns the name of the [Object].
	GetName() string
	// Validate performs static validation of the [Object].
	Validate() error
}

Object represents a generic OpenSLO object definition. All OpenSLO objects implement this interface.

type ObjectValidator added in v0.7.0

type ObjectValidator[T Object] interface {
	// GetValidator returns a fully initialized [govy.Validator] instance for this specific [Object].
	GetValidator() govy.Validator[T]
}

ObjectValidator is an interface implemented by every Object. It is separated from the Object interface in order to keep the latter non-generic.

type Version

type Version string

Version represents a version of the OpenSLO specification.

const (
	VersionV1alpha Version = "openslo/v1alpha"
	VersionV1      Version = "openslo/v1"
	VersionV2alpha Version = "openslo.com/v2alpha"
)

func ParseVersion added in v0.3.0

func ParseVersion(s string) (Version, error)

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) error

UnmarshalText implements the text encoding.TextUnmarshaler interface.

func (Version) Validate

func (v Version) Validate() error

Directories

Path Synopsis
Package v1 contains the OpenSLO specification version v1alpha definitions.
Package v1 contains the OpenSLO specification version v1alpha definitions.
Package v1alpha defines the OpenSLO specification version v1alpha definitions.
Package v1alpha defines the OpenSLO specification version v1alpha definitions.
Package v2alpha contains the OpenSLO specification version v2alpha definitions.
Package v2alpha contains the OpenSLO specification version v2alpha definitions.

Jump to

Keyboard shortcuts

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