backstage

package
v0.0.0-...-e055f3b Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// APIVersion used in all Backstage resources.
	APIVersion = "backstage.io/v1alpha1"

	// KindComponent is the kind for Backstage components.
	KindComponent = "Component"
)
View Source
const (
	// LifecycleAnnotation is used to populate spec.lifecycle for Components.
	LifecycleAnnotation = "backstage.io/kubernetes-lifecycle"
	// DescriptionAnnotation is used to populate the medata.description for
	// Components.
	DescriptionAnnotation = "backstage.io/kubernetes-description"
)

Unofficial annotations.

View Source
const (
	// AppLabel is the Kubernetes recommended label to indicate that a component
	// is part of an application.
	AppLabel = "app.kubernetes.io/part-of"
)
View Source
const (
	// KindLocation is the kind for Backstage locations.
	KindLocation = "Location"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackstageMetadata

type BackstageMetadata struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty"`
	Tags        []string          `yaml:"tags,omitempty"`
	Links       []Link            `yaml:"links,omitempty"`
}

BackstageMetadata is a struct that contains Backstage-specific metadata.

type Component

type Component struct {
	APIVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Metadata   BackstageMetadata `yaml:"metadata"`
	Spec       ComponentSpec     `yaml:"spec,omitempty"`
}

Component is a representation of a Backstage Location.

type ComponentParser

type ComponentParser struct {
	Accessor meta.MetadataAccessor
	// contains filtered or unexported fields
}

ComponentParser parses the labels and annotations on runtime Objects and extracts components from the labels and annotations.

func NewComponentParser

func NewComponentParser() *ComponentParser

NewComponentParser creates and returns a new ComponentParser ready for use.

func (*ComponentParser) Add

func (p *ComponentParser) Add(list runtime.Object) error

Add a list of objects to the parser.

The list should be a List type, e.g. PodList, DeploymentList etc.

Labels are based on https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/

func (*ComponentParser) Components

func (p *ComponentParser) Components() []Component

Components returns the Components that were discovered during the parsing process.

type ComponentSpec

type ComponentSpec struct {
	Type      string `yaml:"type"`
	Lifecycle string `yaml:"lifecycle"`
	Owner     string `yaml:"owner"`
	System    string `yaml:"system"`
}

ComponentSpec

type Link struct {
	URL   string `yaml:"url"`
	Title string `yaml:"title,omitempty"`
	Icon  string `yaml:"icon,omitempty"`
}

Link is a link for users to access some facet of data for a component.

type Location

type Location struct {
	APIVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Metadata   BackstageMetadata `yaml:"metadata"`
	Spec       LocationSpec      `yaml:"spec,omitempty"`
}

Location is a representation of a Backstage Location.

func NewLocation

func NewLocation(name, description string, targets ...string) *Location

NewLocation creates and returns a prepopulated Location.

type LocationSpec

type LocationSpec struct {
	Targets []string `yaml:"targets,omitempty"`
}

LocationSpec is the spec for Location resources.

Jump to

Keyboard shortcuts

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