Documentation
¶
Index ¶
Constants ¶
View Source
const ( APITypeOpenAPI = "openapi" APITypeAsyncAPI = "asyncapi" APITypeGraphQL = "graphql" APITypeGRPC = "grpc" APILifecycleExperimental = "experimental" APILifecycleProduction = "production" APILifecycleDeprecated = "deprecated" )
View Source
const ( ComponentTypeService = "service" ComponentTypeWebsite = "website" ComponentTypeLibrary = "library" ComponentLifecycleExperimental = "experimental" ComponentLifecycleProduction = "production" ComponentLifecycleDeprecated = "deprecated" )
View Source
const ( KindAPI = "api" KindComponent = "component" KindGroup = "group" KindResource = "resource" KindSystem = "system" KindUser = "user" )
Variables ¶
View Source
var ( TestOwnerEntityRef = EntityRef{ Kind: KindUser, Namespace: "default", Name: "owner", } TestOwner2EntityRef = EntityRef{ Kind: KindUser, Namespace: "default", Name: "owner2", } TestSystemEntityRef = EntityRef{ Kind: KindSystem, Namespace: "default", Name: "down", } TestSystem2EntityRef = EntityRef{ Kind: KindSystem, Namespace: "default", Name: "shock", } TestComponentEntityRef = EntityRef{ Kind: KindComponent, Namespace: "default", Name: "component", } TestComponent2EntityRef = EntityRef{ Kind: KindComponent, Namespace: "default", Name: "component2", } TestAPI1EntityRef = EntityRef{ Kind: KindAPI, Namespace: "default", Name: "api1", } TestAPI2EntityRef = EntityRef{ Kind: KindAPI, Namespace: "default", Name: "api2", } TestUser2EntityRef = EntityRef{ Kind: KindUser, Namespace: "default", Name: "user2", } TestGroupEntityRef = EntityRef{ Kind: KindGroup, Namespace: "default", Name: "group", } TestGroup2EntityRef = EntityRef{ Kind: KindGroup, Namespace: "default", Name: "group2", } TestResource1EntityRef = EntityRef{ Kind: KindResource, Namespace: "default", Name: "resource1", } TestResource2EntityRef = EntityRef{ Kind: KindResource, Namespace: "default", Name: "resource2", } TestFullEntity = Entity{ APIVersion: "backstage.io/v1alpha1", Kind: "unknown", Metadata: Metadata{ Name: "my-service", Namespace: "my-namespace", Title: "my-title", Description: "my-description", Labels: map[string]string{ "key1": "value1", "key2": "value2", "key3": "value3", }, Annotations: map[string]string{ "keya": "valuea", "keyb": "valueb", "keyc": "valuec", }, Tags: []string{"tag1", "tag2", "tag3"}, Links: []Link{ { URL: "http://example.com/url1", Title: "link1", Icon: "icon1", Type: "linktype1", }, { URL: "http://example.com/url2", Title: "link2", Icon: "icon2", Type: "linktype2", }, }, }, } TestFullComponent = Component{ Entity: TestFullEntity, Spec: ComponentSpec{ Type: ComponentTypeService, Lifecycle: ComponentLifecycleExperimental, Owner: TestOwnerEntityRef, System: TestSystemEntityRef, SubcomponentOf: TestComponentEntityRef, ProvidesAPIs: []EntityRef{ TestAPI1EntityRef, }, ConsumesAPIs: []EntityRef{ TestAPI2EntityRef, }, DependsOn: []EntityRef{ TestResource1EntityRef, }, DependencyOf: []EntityRef{ TestResource2EntityRef, }, }, } TestFullAPI = API{ Entity: TestFullEntity, Spec: APISpec{ Type: APITypeOpenAPI, Lifecycle: APILifecycleExperimental, Owner: TestOwnerEntityRef, System: TestSystemEntityRef, Definition: "definition", }, } TestFullUser = User{ Entity: TestFullEntity, Spec: UserSpec{ Profile: UserProfile{ DisplayName: "displayName", Email: "email", Picture: "picture", }, MemberOf: []EntityRef{ TestGroupEntityRef, }, }, } TestFullGroup = Group{ Entity: TestFullEntity, Spec: GroupSpec{ Type: "team", Profile: GroupProfile{ DisplayName: "displayName", Email: "email", Picture: "picture", }, Parent: TestGroupEntityRef, Children: []EntityRef{ { Kind: KindGroup, Namespace: "default", Name: "child", }, }, Members: []EntityRef{ TestFullUser.EntityRef(), }, }, } TestMinimalEntity = Entity{ APIVersion: "backstage.io/v1alpha1", Kind: KindAPI, Metadata: Metadata{ Name: "my-service", Namespace: "my-namespace", }, } )
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
Entity `yaml:"entity,inline"`
Spec ComponentSpec `yaml:"spec"`
}
type ComponentSpec ¶
type ComponentSpec struct {
Type string `yaml:"type"`
Lifecycle string `yaml:"lifecycle"`
Owner EntityRef `yaml:"owner"`
System EntityRef `yaml:"system,omitempty"`
SubcomponentOf EntityRef `yaml:"subcomponentOf,omitempty"`
ProvidesAPIs []EntityRef `yaml:"providesApis,omitempty"`
ConsumesAPIs []EntityRef `yaml:"consumesApis,omitempty"`
DependsOn []EntityRef `yaml:"dependsOn,omitempty"`
DependencyOf []EntityRef `yaml:"dependencyOf,omitempty"`
}
type Entity ¶
type EntityRefs ¶
type EntityRefs struct {
// contains filtered or unexported fields
}
func MakeEntityRefs ¶
func MakeEntityRefs(items []EntityRef) EntityRefs
func (EntityRefs) Items ¶
func (es EntityRefs) Items() []EntityRef
func (*EntityRefs) Scan ¶
func (es *EntityRefs) Scan(src any) error
type GroupProfile ¶
type GroupSpec ¶
type GroupSpec struct {
Type string `yaml:"type"`
Profile GroupProfile `yaml:"profile,omitempty"`
Parent EntityRef `yaml:"parent,omitempty"`
Children []EntityRef `yaml:"children"`
Members []EntityRef `yaml:"members,omitempty"`
}
type Metadata ¶
type Metadata struct {
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
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"`
}
type SearchResults ¶
type UserProfile ¶
type UserSpec ¶
type UserSpec struct {
Profile UserProfile `yaml:"profile,omitempty"`
MemberOf []EntityRef `yaml:"memberOf"`
}
Click to show internal directories.
Click to hide internal directories.