encoding

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BackstageV1alpha1 = "backstage.io/v1alpha1"

Variables

This section is empty.

Functions

func Kind added in v0.2.3

func Kind(spec Spec) (string, error)

func SafeName added in v0.2.3

func SafeName(str string) string

Strings of length at least 1, and at most 63 Must consist of sequences of [a-z0-9A-Z] possibly separated by one of [-_.]

Types

type Api

type Api struct {
	Type       string    `yaml:"type"`
	Lifecycle  string    `yaml:"lifecycle"`
	Owner      Reference `yaml:"owner"`
	Definition string    `yaml:"definition"`
	System     Reference `yaml:"system,omitempty"`
}

type Component added in v0.2.3

type Component struct {
	Type           string      `yaml:"type"`
	Lifecycle      string      `yaml:"lifecycle"`
	Owner          Reference   `yaml:"owner"`
	System         Reference   `yaml:"system,omitempty"`
	SubComponentOf Reference   `yaml:"subcomponentOf,omitempty"`
	ProvidesApis   []Reference `yaml:"providesApis,omitempty"`
	ConsumesApis   []Reference `yaml:"consumesApis,omitempty"`
	DependsOn      []Reference `yaml:"dependsOn,omitempty"`
}

type Domain added in v0.2.3

type Domain struct {
	Owner Reference `yaml:"owner"`
}

type Envelope

type Envelope struct {
	ApiVersion string     `yaml:"apiVersion,omitempty"`
	Kind       string     `yaml:"kind,omitempty"`
	Metadata   *Metadata  `yaml:"metadata,omitempty"`
	Relations  []Relation `yaml:"relations,omitempty"`
	Spec       Spec       `yaml:"spec,omitempty"`
}

https://backstage.io/docs/features/software-catalog/descriptor-format#common-to-all-kinds-the-envelope

func NewEnvelope

func NewEnvelope(metadata *Metadata, spec Spec) (*Envelope, error)

will automatically fix name and namespace using SafeName

func (*Envelope) Reference added in v0.2.3

func (e *Envelope) Reference() Reference

https://backstage.io/docs/features/software-catalog/references format: [<kind>:][<namespace>/]<name>

type Group

type Group struct {
	Type     string      `yaml:"type"`
	Profile  interface{} `yaml:"profile,omitempty"`
	Parent   Reference   `yaml:"parent,omitempty"`
	Children []Reference `yaml:"children"`
	Members  []Reference `yaml:"members,omitempty"`
}
type Link struct {
	URL   string `yaml:"url,omitempty"`
	Title string `yaml:"title,omitempty"`
	Icon  string `yaml:"icon,omitempty"`
	Type  string `yaml:"type,omitempty"`
}

https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional

type Location

type Location struct {
	Type     string   `yaml:"type,omitempty"`
	Target   string   `yaml:"target,omitempty"`
	Targets  []string `yaml:"targets,omitempty"`
	Presence string   `yaml:"presence,omitempty"` // "required" (default) | "optional"
}

type Metadata

type Metadata struct {
	Name        string            `yaml:"name,omitempty"`
	Namespace   string            `yaml:"namespace,omitempty"`
	Title       string            `yaml:"title,omitempty"`
	Description string            `yaml:"description,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty"`
	Tags        []string          `yaml:"tags,omitempty"`
	Links       []Link            `yaml:"links,omitempty"`
}

https://backstage.io/docs/features/software-catalog/descriptor-format#common-to-all-kinds-the-metadata

type Reference

type Reference string

https://backstage.io/docs/features/software-catalog/references [<kind>:][<namespace>/]<name>

type Relation added in v0.2.3

type Relation struct {
	Target Reference `yaml:"target,omitempty"`
	Type   string    `yaml:"type,omitempty"`
}

https://backstage.io/docs/features/software-catalog/descriptor-format#common-to-all-kinds-relations

type Spec added in v0.2.3

type Spec interface{}

type System added in v0.2.3

type System struct {
	Owner  Reference `yaml:"owner"`
	Domain Reference `yaml:"domain,omitempty"`
}

type User added in v0.2.3

type User struct {
	MemberOf []Reference `yaml:"memberOf"`
	Profile  interface{} `yaml:"profile,omitempty"`
}

Jump to

Keyboard shortcuts

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