api

package
v0.0.0-...-6a3c6e2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: Apache-2.0 Imports: 1 Imported by: 25

Documentation

Overview

Package api will have all the basic objects that will be used to work in the application. The objects will be versioned by version and kind, also every object will have serialization capabilities using the apimachinery/serializers package in YAML, JSON and Protobuffer formats.

Index

Constants

View Source
const (
	LabelNode       = "node"
	LabelFailure    = "failure"
	LabelExperiment = "experiment"
	LabelID         = "id"
)

Common reserved labels that are standarized and used by the system, they are reserved and can only be used by the system.

Variables

View Source
var NoObjectMeta = ObjectMeta{}

NoObjectMeta is a shortcut to specify the object is not an object.

Functions

func GetAllReserverLabels

func GetAllReserverLabels() map[string]struct{}

GetAllReserverLabels will return all the reserved labels on the system.

Types

type Kind

type Kind string

Kind represents the kind of the object

type ListMeta

type ListMeta struct {
	// Continue if not empty means that there are more objects remaining in the list
	Continue string `json:"continue,omitempty"`
}

ListMeta is the metadata all the objects lists should have.

type ListOptions

type ListOptions struct {
	TypeMeta      `json:",inline"`
	LabelSelector map[string]string `json:"labelSelector,omitempty"`
}

ListOptions are the options required to list & watch objects.

func (ListOptions) DeepCopy

func (l ListOptions) DeepCopy() Object

DeepCopy satisfies object interface.

func (ListOptions) GetObjectKind

func (l ListOptions) GetObjectKind() Kind

GetObjectKind satisfies Object interface.

func (ListOptions) GetObjectMetadata

func (l ListOptions) GetObjectMetadata() ObjectMeta

GetObjectMetadata isn't needed in this kind of object.

func (ListOptions) GetObjectVersion

func (l ListOptions) GetObjectVersion() Version

GetObjectVersion satisfies Object interface.

type Object

type Object interface {
	// GetObjectKind returns the kind of the object.
	GetObjectKind() Kind
	// GetObjectVersion returns the version of the object.
	GetObjectVersion() Version
	// GetObjectMetadata returns the metadata of the object.
	GetObjectMetadata() ObjectMeta
	// DeepCopy makes a copy of the object.
	DeepCopy() Object
}

Object is an interface that every configuration object that can be converted, used & stored needs to implement.

type ObjectList

type ObjectList interface {
	Object
	GetListMetadata() ListMeta
	GetItems() []Object
}

ObjectList is an object that is also a list of objects.

type ObjectMeta

type ObjectMeta struct {
	// ID is the id of the object.
	ID string `json:"id,omitempty"`
	// Labels are key/value pairs related with the object used to identify the object.
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations are free key/value pairs related with the object that aren't queryable.
	Annotations map[string]string `json:"annotations,omitempty"`
}

ObjectMeta is the metadata all the objects should have.

type TypeMeta

type TypeMeta struct {
	// Kind represents the kind of the object
	Kind Kind `json:"kind,omitempty"`
	// Version represents the version of the object
	Version Version `json:"version,omitempty"`
}

TypeMeta is the meta type all the objects should have

func (TypeMeta) GetObjectKind

func (t TypeMeta) GetObjectKind() Kind

GetObjectKind satisfies Object interface.

func (TypeMeta) GetObjectVersion

func (t TypeMeta) GetObjectVersion() Version

GetObjectVersion satisfies Object interface.

func (TypeMeta) String

func (t TypeMeta) String() string

type Version

type Version string

Version represents the version of the object

Directories

Path Synopsis
chaos
v1
v1/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.
cluster
v1
v1/pb
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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