mdl

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Overview

Package mdl defines data structures that represent a software architecture model and accompanying views that follow the C4 model (https://c4model.com).

The data structures can be serialized into JSON. The top level data structure is Design which defines the model and views as well as a name, description and version for the design. Model describes the people, software systems, containers and components that make up the architecture as well as the deployment nodes that represent runtime deployments. Views describes diagrams that represent different level of details - from contextual views that represent the overall system in context with other systems to component level views that render software components and their relationships.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnimationStep added in v1.7.0

type AnimationStep struct {
	// Order of animation step.
	Order int `json:"order"`
	// Set of element IDs that should be included.
	Elements []string `json:"elements,omitempty"`
	// Set of relationship IDs tat should be included.
	Relationships []string `json:"relationships,omitempty"`
}

AnimationStep represents an animation step.

type AutoLayout added in v1.7.0

type AutoLayout struct {
	// Implementation used for automatic layouting of the view
	Implementation ImplementationKind `json:"implementation,omitempty"`
	// Algorithm rank direction.
	RankDirection RankDirectionKind `json:"rankDirection,omitempty"`
	// RankSep defines the separation between ranks in pixels.
	RankSep *int `json:"rankSeparation,omitempty"`
	// NodeSep defines the separation between nodes in pixels.
	NodeSep *int `json:"nodeSeparation,omitempty"`
	// EdgeSep defines the separation between edges in pixels.
	EdgeSep *int `json:"edgeSeparation,omitempty"`
	// Render vertices if true.
	Vertices *bool `json:"vertices,omitempty"`
}

AutoLayout describes an automatic layout.

type BorderKind added in v1.7.0

type BorderKind int

BorderKind is the enum used to represent element border styles.

const (
	BorderUndefined BorderKind = iota
	BorderSolid
	BorderDashed
	BorderDotted
)

func (BorderKind) MarshalJSON added in v1.7.0

func (b BorderKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (*BorderKind) UnmarshalJSON added in v1.7.0

func (b *BorderKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type Component added in v1.7.0

type Component struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Technology used by element if any - not applicable to Person.
	Technology string `json:"technology,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
}

Component represents a component.

type ComponentView added in v1.7.0

type ComponentView struct {
	*ViewProps
	// Specifies whether container boundaries should be visible for
	// "external" containers (those outside the container in scope).
	ContainerBoundariesVisible *bool `json:"externalContainersBoundariesVisible,omitempty"`
	// The ID of the container this view is associated with.
	ContainerID string `json:"containerId"`
}

ComponentView describes a component view for a specific container.

func (*ComponentView) MarshalJSON added in v1.7.0

func (v *ComponentView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type Container added in v1.7.0

type Container struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Technology used by element if any - not applicable to Person.
	Technology string `json:"technology,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
	// Components list the components within the container.
	Components []*Component `json:"components,omitempty"`
}

Container represents a container.

type ContainerInstance added in v1.7.0

type ContainerInstance struct {
	// ID of element.
	ID string `json:"id"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
	// ID of container that is instantiated.
	ContainerID string `json:"containerId"`
	// InstanceID is the number/index of this instance.
	InstanceID int `json:"instanceId"`
	// Environment is the deployment environment of this instance.
	Environment string `json:"environment"`
	// HealthChecks is the set of HTTP-based health checks for this
	// container instance.
	HealthChecks []*HealthCheck `json:"healthChecks,omitempty"`
}

ContainerInstance describes an instance of a container.

type ContainerView added in v1.7.0

type ContainerView struct {
	*ViewProps
	// Specifies whether software system boundaries should be visible for
	// "external" containers (those outside the software system in scope).
	SystemBoundariesVisible *bool `json:"externalSoftwareSystemBoundariesVisible,omitempty"`
	// SoftwareSystemID is the ID of the software system this view with is
	// associated with.
	SoftwareSystemID string `json:"softwareSystemId"`
}

ContainerView describes a container view for a specific software system.

func (*ContainerView) MarshalJSON added in v1.7.0

func (v *ContainerView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type ContextView added in v1.7.0

type ContextView struct {
	*ViewProps
	// EnterpriseBoundaryVisible specifies whether the enterprise boundary
	// (to differentiate internal elements from external elements) should be
	// visible on the resulting diagram.
	EnterpriseBoundaryVisible *bool `json:"enterpriseBoundaryVisible,omitempty"`
	// SoftwareSystemID is the ID of the software system this view with is
	// associated with.
	SoftwareSystemID string `json:"softwareSystemId"`
}

ContextView describes a system context view.

func (*ContextView) MarshalJSON added in v1.7.0

func (v *ContextView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type DeploymentNode added in v1.7.0

type DeploymentNode struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Technology used by element if any - not applicable to Person.
	Technology string `json:"technology,omitempty"`
	// Environment is the deployment environment in which this deployment
	// node resides (e.g. "Development", "Live", etc).
	Environment string `json:"environment"`
	// Instances is the number of instances.
	Instances *string `json:"instances,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Children describe the child deployment nodes if any.
	Children []*DeploymentNode `json:"children,omitempty"`
	// InfrastructureNodes describe the infrastructure nodes (load
	// balancers, firewall etc.)
	InfrastructureNodes []*InfrastructureNode `json:"infrastructureNodes,omitempty"`
	// ContainerInstances describe instances of containers deployed in
	// deployment node.
	ContainerInstances []*ContainerInstance `json:"containerInstances,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
}

DeploymentNode describes a single deployment node.

type DeploymentView added in v1.7.0

type DeploymentView struct {
	*ViewProps
	// SoftwareSystemID is the ID of the software system this view with is
	// associated with if any.
	SoftwareSystemID string `json:"softwareSystemId,omitempty"`
	// The name of the environment that this deployment view is for (e.g.
	// "Development", "Live", etc).
	Environment string `json:"environment"`
}

DeploymentView describes a deployment view.

func (*DeploymentView) MarshalJSON added in v1.7.0

func (v *DeploymentView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type Design added in v1.7.0

type Design struct {
	// Name of the design.
	Name string `json:"name"`
	// Description of the design if any.
	Description string `json:"description,omitempty"`
	// Version number for the design.
	Version string `json:"version,omitempty"`
	// Model is the software architecture model.
	Model *Model `json:"model,omitempty"`
	// Views contains the views if any.
	Views *Views `json:"views,omitempty"`
}

Design is the root node of the data model

func ModelizeDesign added in v1.7.0

func ModelizeDesign(d *expr.Design) *Design

func RunDSL

func RunDSL() (*Design, error)

RunDSL runs the DSL defined in a global variable and returns a JSON serializable version of it.

type DynamicView added in v1.7.0

type DynamicView struct {
	*ViewProps
	// ElementID is the identifier of the element this view is associated with.
	ElementID string `json:"elementId"`
}

DynamicView describes a dynamic view for a specified scope.

func (*DynamicView) MarshalJSON added in v1.7.0

func (v *DynamicView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type ElementStyle added in v1.7.0

type ElementStyle struct {
	// Tag to which this style applies.
	Tag string `json:"tag,omitempty"`
	// Width of element, in pixels.
	Width *int `json:"width,omitempty"`
	// Height of element, in pixels.
	Height *int `json:"height,omitempty"`
	// Background color of element as HTML RGB hex string (e.g. "#ffffff")
	Background string `json:"background,omitempty"`
	// Stroke color of element as HTML RGB hex string (e.g. "#000000")
	Stroke string `json:"stroke,omitempty"`
	// Foreground (text) color of element as HTML RGB hex string (e.g. "#ffffff")
	Color string `json:"color,omitempty"`
	// Standard font size used to render text, in pixels.
	FontSize *int `json:"fontSize,omitempty"`
	// Shape used to render element.
	Shape ShapeKind `json:"shape,omitempty"`
	// URL of PNG/JPG/GIF file or Base64 data URI representation.
	Icon string `json:"icon,omitempty"`
	// Type of border used to render element.
	Border BorderKind `json:"border,omitempty"`
	// Opacity used to render element; 0-100.
	Opacity *int `json:"opacity,omitempty"`
	// Whether element metadata should be shown.
	Metadata *bool `json:"metadata,omitempty"`
	// Whether element description should be shown.
	Description *bool `json:"description,omitempty"`
}

ElementStyle defines an element style.

type ElementView added in v1.7.0

type ElementView struct {
	// ID of element.
	ID string `json:"id"`
	// Horizontal position of element when rendered
	X *int `json:"x,omitempty"`
	// Vertical position of element when rendered.
	Y *int `json:"y,omitempty"`
}

ElementView describes an instance of a model element (Person, Software System, Container or Component) in a View.

type Enterprise added in v1.7.0

type Enterprise struct {
	// Name of enterprise.
	Name string `json:"name"`
}

Enterprise describes a named enterprise / organization.

type FilteredView added in v1.7.0

type FilteredView struct {
	// Title of the view.
	Title string `json:"title,omitempty"`
	// Description of view.
	Description string `json:"description,omitempty"`
	// Key used to refer to the view.
	Key string `json:"key"`
	// BaseKey is the key of the view on which this filtered view is based.
	BaseKey string `json:"baseViewKey"`
	// Whether elements/relationships are being included ("Include") or
	// excluded ("Exclude") based upon the set of tags.
	Mode string `json:"mode"`
	// The set of tags to include/exclude elements/relationships when
	// rendering this filtered view.
	Tags []string `json:"tags,omitempty"`
}

FilteredView describes a filtered view on top of a specified view.

func (*FilteredView) MarshalJSON added in v1.7.0

func (v *FilteredView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type HealthCheck added in v1.7.0

type HealthCheck struct {
	// Name of health check.
	Name string `json:"name"`
	// Health check URL/endpoint.
	URL string `json:"url"`
	// Polling interval, in seconds.
	Interval int `json:"interval"`
	// Timeout after which health check is deemed as failed, in milliseconds.
	Timeout int `json:"timeout"`
	// Set of name-value pairs corresponding to HTTP headers to be sent with request.
	Headers map[string]string `json:"headers"`
}

HealthCheck is a HTTP-based health check.

type ImplementationKind added in v1.9.1

type ImplementationKind int

ImplementationKind is the enum for possible automatic layout implementations

const (
	ImplementationUndefined ImplementationKind = iota
	ImplementationGraphviz
	ImplementationDagre
)

func (ImplementationKind) MarshalJSON added in v1.9.1

func (i ImplementationKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (ImplementationKind) Name added in v1.9.1

func (i ImplementationKind) Name() string

Name returns the name of the implementation used in the automatic layout of the view.

func (*ImplementationKind) UnmarshalJSON added in v1.9.1

func (i *ImplementationKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type InfrastructureNode added in v1.7.0

type InfrastructureNode struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Technology used by element if any - not applicable to Person.
	Technology string `json:"technology,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
	// Environment is the deployment environment in which this
	// infrastructure node resides (e.g. "Development", "Live",
	// etc).
	Environment string `json:"environment"`
}

InfrastructureNode describes an infrastructure node.

type InteractionStyleKind added in v1.7.0

type InteractionStyleKind int

InteractionStyleKind is the enum for possible interaction styles.

const (
	// InteractionUndefined means no interaction style specified in design.
	InteractionUndefined InteractionStyleKind = iota
	// InteractionSynchronous describes a synchronous interaction.
	InteractionSynchronous
	// InteractionAsynchronous describes an asynchronous interaction.
	InteractionAsynchronous
)

func (InteractionStyleKind) MarshalJSON added in v1.7.0

func (i InteractionStyleKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (*InteractionStyleKind) UnmarshalJSON added in v1.7.0

func (i *InteractionStyleKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type LandscapeView added in v1.7.0

type LandscapeView struct {
	*ViewProps
	// EnterpriseBoundaryVisible specifies whether the enterprise boundary
	// (to differentiate internal elements from external elements) should be
	// visible on the resulting diagram.
	EnterpriseBoundaryVisible *bool `json:"enterpriseBoundaryVisible,omitempty"`
}

LandscapeView describes a system landscape view.

func (*LandscapeView) MarshalJSON added in v1.7.0

func (v *LandscapeView) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type LocationKind added in v1.7.0

type LocationKind int

LocationKind is the enum for possible locations.

const (
	// LocationUndefined means no location specified in design.
	LocationUndefined LocationKind = iota
	// LocationInternal defines an element internal to the enterprise.
	LocationInternal
	// LocationExternal defines an element external to the enterprise.
	LocationExternal
)

func (LocationKind) MarshalJSON added in v1.7.0

func (l LocationKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (*LocationKind) UnmarshalJSON added in v1.7.0

func (l *LocationKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type Model added in v1.7.0

type Model struct {
	// Enterprise associated with model if any.
	Enterprise *Enterprise `json:"enterprise,omitempty"`
	// People lists Person elements.
	People []*Person `json:"people,omitempty"`
	// Systems lists Software System elements.
	Systems []*SoftwareSystem `json:"softwareSystems,omitempty"`
	// DeploymentNodes list the deployment nodes.
	DeploymentNodes []*DeploymentNode `json:"deploymentNodes,omitempty"`
}

Model describes a software architecture model.

func (*Model) MarshalJSON added in v1.7.0

func (m *Model) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type PaperSizeKind added in v1.7.0

type PaperSizeKind int

PaperSizeKind is the enum for possible paper kinds.

const (
	SizeUndefined PaperSizeKind = iota
	SizeA0Landscape
	SizeA0Portrait
	SizeA1Landscape
	SizeA1Portrait
	SizeA2Landscape
	SizeA2Portrait
	SizeA3Landscape
	SizeA3Portrait
	SizeA4Landscape
	SizeA4Portrait
	SizeA5Landscape
	SizeA5Portrait
	SizeA6Landscape
	SizeA6Portrait
	SizeLegalLandscape
	SizeLegalPortrait
	SizeLetterLandscape
	SizeLetterPortrait
	SizeSlide16X10
	SizeSlide16X9
	SizeSlide4X3
)

func (PaperSizeKind) MarshalJSON added in v1.7.0

func (p PaperSizeKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (PaperSizeKind) Name added in v1.9.1

func (p PaperSizeKind) Name() string

Name is the name of the paper size kind as it appears in the DSL.

func (*PaperSizeKind) UnmarshalJSON added in v1.7.0

func (p *PaperSizeKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type Person added in v1.7.0

type Person struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
	// Location of person.
	Location LocationKind `json:"location,omitempty"`
}

Person represents a person.

type RankDirectionKind added in v1.7.0

type RankDirectionKind int

RankDirectionKind is the enum for possible automatic layout rank directions.

const (
	RankUndefined RankDirectionKind = iota
	RankTopBottom
	RankBottomTop
	RankLeftRight
	RankRightLeft
)

func (RankDirectionKind) MarshalJSON added in v1.7.0

func (r RankDirectionKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (RankDirectionKind) Name added in v1.9.1

func (r RankDirectionKind) Name() string

Name returns the name of the rank direction is specified in the DSL.

func (*RankDirectionKind) UnmarshalJSON added in v1.7.0

func (r *RankDirectionKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type Relationship added in v1.7.0

type Relationship struct {
	// ID of relationship.
	ID string `json:"id"`
	// Description of relationship if any.
	Description string `json:"description"`
	// Tags attached to relationship as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information can be found.
	URL string `json:"url,omitempty"`
	// SourceID is the ID of the source element.
	SourceID string `json:"sourceId"`
	// DestinationID is ID the destination element.
	DestinationID string `json:"destinationId"`
	// Technology associated with relationship.
	Technology string `json:"technology,omitempty"`
	// InteractionStyle describes whether the interaction is synchronous or
	// asynchronous
	InteractionStyle InteractionStyleKind `json:"interactionStyle"`
	// ID of container-container relationship upon which this container
	// instance-container instance relationship is based.
	LinkedRelationshipID string `json:"linkedRelationshipId,omitempty"`
}

Relationship describes a uni-directional relationship between two elements.

type RelationshipStyle added in v1.7.0

type RelationshipStyle struct {
	// Tag to which this style applies.
	Tag string `json:"tag,omitempty"`
	// Thickness of line, in pixels.
	Thickness *int `json:"thickness,omitempty"`
	// Color of line as HTML RGB hex string (e.g. "#ffffff").
	Color string `json:"color,omitempty"`
	// Standard font size used to render relationship annotation, in pixels.
	FontSize *int `json:"fontSize,omitempty"`
	// Width of relationship annotation, in pixels.
	Width *int `json:"width,omitempty"`
	// Whether line is rendered dashed or not.
	Dashed *bool `json:"dashed,omitempty"`
	// Routing algorithm used to render lines.
	Routing RoutingKind `json:"routing,omitempty"`
	// Position of annotation along the line; 0 (start) to 100 (end).
	Position *int `json:"position,omitempty"`
	// Opacity used to render line; 0-100.
	Opacity *int `json:"opacity,omitempty"`
}

RelationshipStyle defines a relationship style.

type RelationshipView added in v1.7.0

type RelationshipView struct {
	// ID of relationship.
	ID string `json:"id"`
	// Description of relationship used in dynamic views.
	Description string `json:"description,omitempty"`
	// Order of relationship in dynamic views.
	Order string `json:"order,omitempty"`
	// Set of vertices used to render relationship
	Vertices []*Vertex `json:"vertices,omitempty"`
	// Routing algorithm used to render relationship.
	Routing RoutingKind `json:"routing,omitempty"`
	// Position of annotation along line; 0 (start) to 100 (end).
	Position *int `json:"position,omitempty"`
}

RelationshipView describes an instance of a model relationship in a view.

type RoutingKind added in v1.7.0

type RoutingKind int

RoutingKind is the enum for possible routing algorithms.

const (
	RoutingUndefined RoutingKind = iota
	RoutingDirect
	RoutingOrthogonal
	RoutingCurved
)

func (RoutingKind) MarshalJSON added in v1.7.0

func (r RoutingKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (*RoutingKind) UnmarshalJSON added in v1.7.0

func (r *RoutingKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type ShapeKind added in v1.7.0

type ShapeKind int

ShapeKind is the enum used to represent shapes used to render elements.

const (
	ShapeUndefined ShapeKind = iota
	ShapeBox
	ShapeCircle
	ShapeCylinder
	ShapeEllipse
	ShapeHexagon
	ShapeRoundedBox
	ShapeComponent
	ShapeFolder
	ShapeMobileDeviceLandscape
	ShapeMobileDevicePortrait
	ShapePerson
	ShapePipe
	ShapeRobot
	ShapeWebBrowser
)

func (ShapeKind) MarshalJSON added in v1.7.0

func (s ShapeKind) MarshalJSON() ([]byte, error)

MarshalJSON replaces the constant value with the proper string value.

func (*ShapeKind) UnmarshalJSON added in v1.7.0

func (s *ShapeKind) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the constant from its JSON representation.

type SoftwareSystem added in v1.7.0

type SoftwareSystem struct {
	// ID of element.
	ID string `json:"id"`
	// Name of element - not applicable to ContainerInstance.
	Name string `json:"name,omitempty"`
	// Description of element if any.
	Description string `json:"description,omitempty"`
	// Tags attached to element as comma separated list if any.
	Tags string `json:"tags,omitempty"`
	// URL where more information about this element can be found.
	URL string `json:"url,omitempty"`
	// Set of arbitrary name-value properties (shown in diagram tooltips).
	Properties map[string]string `json:"properties,omitempty"`
	// Relationships is the set of relationships from this element to other
	// elements.
	Relationships []*Relationship `json:"relationships,omitempty"`
	// Location of element.
	Location LocationKind `json:"location,omitempty"`
	// Containers list the containers within the software system.
	Containers []*Container `json:"containers,omitempty"`
}

SoftwareSystem represents a software system.

type Styles added in v1.7.0

type Styles struct {
	// Elements is the set of element styles.
	Elements []*ElementStyle `json:"elements,omitempty"`
	// Relationships is the set of relationship styles.
	Relationships []*RelationshipStyle `json:"relationships,omitempty"`
}

Styles describe styles associated with set of views.

func (*Styles) MarshalJSON added in v1.7.0

func (s *Styles) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

type Vertex added in v1.7.0

type Vertex struct {
	// Horizontal position of vertex when rendered.
	X int `json:"x"`
	// Vertical position of vertex when rendered.
	Y int `json:"y"`
}

Vertex describes the x and y coordinate of a bend in a line.

type ViewProps added in v1.7.0

type ViewProps struct {
	// Title of the view
	Title string `json:"title,omitempty"`
	// Description of view
	Description string `json:"description,omitempty"`
	// Key used to identify the view
	Key string `json:"key"`
	// A number representing the creation order of this view.
	Order float32 `json:"order"`
	// PaperSize is the paper size that should be used to render this view.
	PaperSize PaperSizeKind `json:"paperSize,omitempty"`
	// AutoLayout describes the automatic layout mode for the diagram if
	// defined.
	AutoLayout *AutoLayout `json:"automaticLayout,omitempty"`
	// ElementViews lists the elements included in the view.
	ElementViews []*ElementView `json:"elements,omitempty"`
	// RelationshipViews lists the relationships included in the view.
	RelationshipViews []*RelationshipView `json:"relationships,omitempty"`
	// Animations describes the animation steps if any.
	Animations []*AnimationStep `json:"animations,omitempty"`
}

ViewProps contains common properties for all views.

type Views added in v1.7.0

type Views struct {
	// LandscapeViewss describe the system landscape views.
	LandscapeViews []*LandscapeView `json:"systemLandscapeViews,omitempty"`
	// ContextViews lists the system context views.
	ContextViews []*ContextView `json:"systemContextViews,omitempty"`
	// ContainerViews lists the container views.
	ContainerViews []*ContainerView `json:"containerViews,omitempty"`
	// ComponentViews lists the component views.
	ComponentViews []*ComponentView `json:"componentViews,omitempty"`
	// DynamicViews lists the dynamic views.
	DynamicViews []*DynamicView `json:"dynamicViews,omitempty"`
	// DeploymentViews lists the deployment views.
	DeploymentViews []*DeploymentView `json:"deploymentViews,omitempty"`
	// FilteredViews lists the filtered views.
	FilteredViews []*FilteredView `json:"filteredViews,omitempty"`
	// Styles associated with views.
	Styles *Styles `json:"styles,omitempty"`
}

Views is the container for all views.

func (*Views) MarshalJSON added in v1.7.0

func (v *Views) MarshalJSON() ([]byte, error)

MarshalJSON guarantees the order of elements in generated JSON arrays that correspond to sets.

Jump to

Keyboard shortcuts

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