catalog

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const PackageHTMLTemplate = header + PackageHTMLTemplateWithoutCSS + style + endTags
View Source
const PackageHTMLTemplateWithoutCSS = `` /* 1645-byte string literal not displayed */
View Source
const PackageMarkdownTemplate = `` /* 1378-byte string literal not displayed */
View Source
const ProjectHTMLTemplate = header + ProjectHTMLTemplatePackageTemplateWithoutCSS + style + endTags
View Source
const ProjectHTMLTemplatePackageTemplateWithoutCSS = `` /* 449-byte string literal not displayed */
View Source
const ProjectMarkdownTemplate = `` /* 357-byte string literal not displayed */

Variables

This section is empty.

Functions

func AlphabeticalApps

func AlphabeticalApps(m map[string]*sysl.Application) []string

AlphabeticalEndpoints sorts a map of Applications alphabetically

func AlphabeticalEndpoints

func AlphabeticalEndpoints(m map[string]*sysl.Endpoint) []string

AlphabeticalEndpoints sorts a map of endpoints alphabetically

func AlphabeticalPackage

func AlphabeticalPackage(m map[string]*Package) []string

AlphabeticalEndpoints sorts a map of Package alphabetically

func CreateSequenceDiagram

func CreateSequenceDiagram(m *sysl.Module, call string) (string, error)

func GenerateDiagramAndMarkdown

func GenerateDiagramAndMarkdown(sd *Diagram) error

GenerateDiagramAndMarkdown generates diagrams and markdown for sysl diagrams.

func GenerateMarkdown

func GenerateMarkdown(outputdir, fileName string, object interface{}, t *template.Template, fs afero.Fs) error

GenerateMarkdown generates markdown for any object.

func GetAppPackageName

func GetAppPackageName(app *sysl.Application) (string, string)

GetAppPackageName returns the package and app name of any sysl application

func LoadMarkdownTemplates

func LoadMarkdownTemplates(markdowns ...string) ([]*template.Template, error)

LoadMarkdownTemplates loads string markdown templates into slices of template objects.

Types

type Diagram

type Diagram struct {
	Parent                *Package
	Project               *Project
	Endpoint              *sysl.Endpoint
	App                   *sysl.Application
	Type                  *sysl.Type
	OutputDir             string
	PlantUMLDiagramString string
	OutputFileName__      string
	Diagramtype           string
}

PlantUMLDiagramString represents a plantuml diagram with other contextual info.

func (Diagram) AppComment

func (d Diagram) AppComment() string

func (Diagram) AppName

func (d Diagram) AppName() string

func (Diagram) EndpointComment

func (d Diagram) EndpointComment() string

func (Diagram) EndpointName

func (d Diagram) EndpointName() string

func (Diagram) EndpointNameWithoutSpaces

func (d Diagram) EndpointNameWithoutSpaces() string

func (*Diagram) GenerateDiagramAndMarkdown

func (sd *Diagram) GenerateDiagramAndMarkdown() error

GenerateDiagramAndMarkdown generates diagrams and markdown for sysl diagrams.

func (Diagram) Img added in v1.2.6

func (d Diagram) Img() string

func (Diagram) InputDataModel

func (s Diagram) InputDataModel() []*Diagram

InputDataModel Generates request diagrams for the endpoint that's registered in s

func (Diagram) OutputDataModel

func (s Diagram) OutputDataModel() []*Diagram

OutputDataModel Generates return value diagrams for the endpoint that's registered in s

func (Diagram) TypeComment added in v1.2.6

func (d Diagram) TypeComment() string

type Package

type Package struct {
	Parent           *Project
	OutputDir        string
	PackageName      string
	OutputFile       string
	SequenceDiagrams map[string][]*Diagram // map[appName][]*Diagram
	DatabaseModel    map[string]*Diagram
	Integration      *Diagram
	EPAIntegration   *Diagram
}

Package is the second level where apps and endpoints are specified.

func (Package) SequenceDiagramFromEndpoint

func (p Package) SequenceDiagramFromEndpoint(appName string, endpoint *sysl.Endpoint) (*Diagram, error)

SequenceDiagramFromEndpoint generates a sequence diagram from a sysl endpoint

type Project

type Project struct {
	Title                          string
	PageFileName                   string // Is README.md for markdown and index.html for html
	Server                         bool   // Determines wether html refresh header is added
	LiveReload                     bool
	Output                         string
	PlantumlService                string
	OutputFileName                 string
	RootLevelIntegrationDiagramEPA *Diagram
	RootLevelIntegrationDiagram    *Diagram
	Log                            *logrus.Logger
	Packages                       map[string]*Package // Packages are the rows of the top level markdown
	Fs                             afero.Fs
	Module                         *sysl.Module
	DiagramExt                     string                  //.svg or .html if we're in server mode (we don't send requests
	PackageModules                 map[string]*sysl.Module // PackageModules maps @package attr to all those applications
	ProjectTempl                   *template.Template      // Templ is used to template the Project struct
	PackageTempl                   *template.Template      // PackageTempl is passed down to all Packages
}

Project is the top level in the hierarchy of markdown generation

func NewProject

func NewProject(title, outputDir, plantumlservice string, outputType string, log *logrus.Logger, module *sysl.Module) *Project

NewProject generates a Project Markdwon object for all a sysl module

func (Project) AlphabeticalRows

func (p Project) AlphabeticalRows() []*Package

AlphabeticalRows returns an alphabetically sorted list of packages of any project.

func (*Project) CreateIntegrationDiagrams

func (p *Project) CreateIntegrationDiagrams(title, output string, projectApp *sysl.Application, EPA bool) (*Diagram, error)

func (*Project) EnableLiveReload added in v1.2.6

func (p *Project) EnableLiveReload() *Project

func (*Project) ExecuteTemplateAndDiagrams

func (p *Project) ExecuteTemplateAndDiagrams() *Project

ExecuteTemplateAndDiagrams generates all documentation of Project with the registered Markdown

func (Project) GenerateDBDataModel

func (p Project) GenerateDBDataModel(parentAppName string) string

GenerateDBDataModel takes all the types in parentAppName and generates data model diagrams for it

func (Project) GenerateEndpointDataModel

func (p Project) GenerateEndpointDataModel(parentAppName string, t *sysl.Type) string

GenerateEndpointDataModel generates data model diagrams for a specific type

func (Project) RegisterDiagrams

func (p Project) RegisterDiagrams() error

RegisterDiagrams creates sequence Diagrams from the sysl Module in Project.

func (*Project) RegisterTemplates

func (p *Project) RegisterTemplates(projectTemplateString, packageTemplateString string) error

RegisterTemplates registers templates for the project to use

func (*Project) ServeHTTP

func (p *Project) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Project) SetOutputFs

func (p *Project) SetOutputFs(fs afero.Fs) *Project

SetOutputFs sets the output filesystem

func (*Project) SetServerMode added in v1.2.6

func (p *Project) SetServerMode() *Project

func (*Project) Update added in v1.2.6

func (p *Project) Update(m *sysl.Module) *Project

Jump to

Keyboard shortcuts

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