core

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	STATUS_PLANNED    = "planned"
	CATEGORY_EXTERNAL = "external"
)
View Source
const (
	NOGROUP = "nogroup"
	NOTEAM  = "noteam"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	//Id - generated Integer as Id
	Id                         int                        `json:"id" yaml:"id"`
	Name                       string                     `json:"name" yaml:"name"`
	Team                       string                     `json:"team" yaml:"team"`
	Title                      string                     `json:"title,omitempty" yaml:"title,omitempty"`
	Summary                    string                     `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description                string                     `json:"description,omitempty" yaml:"description,omitempty"`
	Group                      string                     `json:"group,omitempty" yaml:"group,omitempty"`
	Technology                 string                     `json:"technology,omitempty" yaml:"technology,omitempty"`
	Category                   string                     `json:"category,omitempty" yaml:"category,omitempty"`
	ProvidedServices           []Service                  `json:"provided-services" yaml:"provided-services"`
	InfrastructureDependencies []InfrastructureDependency `json:"infrastructure-dependencies" yaml:"infrastructure-dependencies"`
	Dependencies               []Dependency               `json:"dependencies" yaml:"dependencies"`
	Display                    ApplicationDisplaySettings `json:"display,omitempty" yaml:"display,omitempty"`
	Properties                 map[string]string          `json:"properties" yaml:"properties"`
	Status                     string                     `json:"status" yaml:"status"`
}

func (*Application) FindService

func (a *Application) FindService(nameToMatch string) (*Service, error)

FindService - returns service object or error

func (*Application) GetAllDependencies

func (a *Application) GetAllDependencies() []Dependency

returns all the Dependencies objects from the current application to others

func (*Application) GetAllDependencyApplications

func (a *Application) GetAllDependencyApplications(Project *Project) ([]*Application, error)

returns the Applications that are a dependency of the current application in the passed project

func (*Application) GetDependenciesGrouped

func (a *Application) GetDependenciesGrouped(project *Project) []*DependenciesGrouped

GetDependenciesGrouped - returns a list of grouped dependencies for this application to others. Useful if you are not interested in the indivudual dependencies but only the general "links" from this app to others

func (*Application) GetDependenciesTo

func (a *Application) GetDependenciesTo(applicationName string) ([]Dependency, error)

GetDependenciesTo returns the Dependencies to a specified other application

func (*Application) GetDescriptionHtml

func (a *Application) GetDescriptionHtml() template.HTML

GetDescriptionHtml - helper that renders the description text as markdown - to be used in HTML documentations

func (*Application) GetGroupPath

func (a *Application) GetGroupPath() []string

GetGroupPath - returns the list of Groups the application is part of (parent to leaf)

func (*Application) GetServiceForDependency

func (a *Application) GetServiceForDependency(dependency *Dependency) *Service

GetServiceForDependency - returns the provided service that is supposed to be referenced by the Dependency

func (*Application) GetSummary

func (a *Application) GetSummary() string

GetSummary - returns summary. If summary is not set the first 100 letters from description

func (*Application) IsOpenHostApp

func (a *Application) IsOpenHostApp() bool

IsOpenHostApp - returns true if the APIs provided by this service are all declared as IsOpenHost.

func (*Application) Validate

func (a *Application) Validate() []error

Validate - validates the Application

type ApplicationDisplaySettings

type ApplicationDisplaySettings struct {
	Rotate      bool   `json:"rotate" yaml:"rotate"`
	BorderColor string `json:"color,omitempty" yaml:"bordercolor,omitempty"`
	Color       string `json:"color,omitempty" yaml:"color,omitempty"`
}

type ApplicationsByGroup

type ApplicationsByGroup struct {
	SubGroups    []*ApplicationsByGroup `json:"subGroups"`
	Applications []*Application         `json:"applications"`
	GroupName    string                 `json:"groupName"`
	IsRoot       bool                   `json:"isRoot"`
}

type DependenciesGrouped

type DependenciesGrouped struct {
	Application       *Application `json:"application"`
	SourceApplication *Application `json:"sourceApplication"`
	Dependencies      []Dependency `json:"dependencies"`
}

DependenciesGrouped Value object represents all Dependencies to one Application

type Dependency

type Dependency struct {
	Reference      string            `json:"reference" yaml:"reference"`
	Description    string            `json:"description" yaml:"description"`
	Relationship   string            `json:"relationship" yaml:"relationship"`
	IsSameLevel    bool              `json:"isSameLevel" yaml:"isSameLevel"`
	IsBrowserBased bool              `json:"isBrowserBased" yaml:"isBrowserBased"`
	Status         string            `json:"status" yaml:"status"`
	Properties     map[string]string `json:"properties" yaml:"properties"`
}

func (*Dependency) GetApplication

func (Dependency *Dependency) GetApplication(Project *Project) (*Application, error)

func (*Dependency) GetApplicationAndServiceNames

func (Dependency *Dependency) GetApplicationAndServiceNames() (string, string)

Returns the name of the "component" and "service" this dependecy points to service might be empty if the dependency just defined the component

func (*Dependency) GetApplicationName

func (Dependency *Dependency) GetApplicationName() string

func (*Dependency) GetServiceName

func (Dependency *Dependency) GetServiceName() string

type InfrastructureDependency

type InfrastructureDependency struct {
	Type string `json:"type" yaml:"type"`
}

type Project

type Project struct {
	Name         string         `json:"name" yaml:"name"`
	Applications []*Application `json:"applications" yaml:"applications"`
}

func (*Project) FindAllApplicationsThatReferenceApplication

func (p *Project) FindAllApplicationsThatReferenceApplication(referencedApplication *Application) []*Application

func (*Project) FindApplication

func (p *Project) FindApplication(nameToMatch string) (*Application, error)

FindApplication - Find by Name

func (*Project) FindApplicationThatReferenceTo

func (p *Project) FindApplicationThatReferenceTo(application *Application, recursive bool) []*Application

Find by Name

func (*Project) FindApplicationsThatReferenceApplication

func (p *Project) FindApplicationsThatReferenceApplication(referencedApplication *Application) []*Application

returns all components that have a direct dependency to the given component

func (*Project) GenerateApplicationIds

func (p *Project) GenerateApplicationIds()

func (*Project) GetApplicationByTeam

func (p *Project) GetApplicationByTeam() map[string][]*Application

GetApplicationByTeam - Get Map with components grouped by Group. NOGROUP is used for ungrouped components

func (*Project) GetApplicationsRootGroup

func (p *Project) GetApplicationsRootGroup() *ApplicationsByGroup

GetApplicationsRootGroup - Returns the Root Group

func (*Project) Validate

func (p *Project) Validate() []error

Validates project and Components

type Service

type Service struct {
	Name          string            `json:"name" yaml:"name"`
	Title         string            `json:"title" yaml:"title"`
	Summary       string            `json:"summary" yaml:"summary"`
	Description   string            `json:"description" yaml:"description"`
	Type          string            `json:"type,omitempty" yaml:"type,omitempty"`
	IsPublic      bool              `json:"isPublic,omitempty" yaml:"isPublic,omitempty"`
	IsOpenHost    bool              `json:"isOpenHost,omitempty" yaml:"isOpenHost,omitempty"`
	SecurityLevel string            `json:"securityLevel" yaml:"securityLevel"`
	Dependencies  []Dependency      `json:"dependencies" yaml:"dependencies"`
	Status        string            `json:"status" yaml:"status"`
	Properties    map[string]string `json:"properties" yaml:"properties"`
}

func (*Service) HasPropertyWithValue

func (s *Service) HasPropertyWithValue(property string, compareValue string) bool

Jump to

Keyboard shortcuts

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