Documentation ¶
Overview ¶
diagram-creation.go: all the methods attached to the generator object to be used in templating
generator.go: struct for converting sysl modules to documentation (Generator)
util.go: misc functions to convert/send http requests/sort maps
Index ¶
- Constants
- func Attribute(a Attr, query string) string
- func CreateFileName(dir string, elems ...string) (string, string)
- func CreateSequenceDiagram(m *sysl.Module, call string) (string, error)
- func FieldType(t *sysl.Type) string
- func Fields(t *sysl.Type) map[string]*sysl.Type
- func Filter(vs []string, f func(string) bool) []string
- func GenerateCatalog(module []byte, templ, plantuml string) (string, error)
- func GetAppPackageName(a Namer) (string, string)
- func GetAppTypeName(param Typer) (appName string, typeName string)
- func GetPackageName(m *sysl.Module, a Namer) string
- func ModulePackageName(m *sysl.Module) string
- func NewTypeRef(appName, typeName string) *sysl.Type
- func PlantUMLURL(plantumlService, contents string) (string, error)
- func SanitiseOutputName(s string) string
- func ServiceMetadata(a Attr) string
- func SortedKeys(m interface{}) []string
- func TernaryOperator(condition bool, i ...interface{}) interface{}
- func UnmarshallJson(b []byte, m *sysl.Module) error
- type Attr
- type Generator
- func (p *Generator) CreateIntegrationDiagram(m *sysl.Module, title string, EPA bool) string
- func (p *Generator) CreateParamDataModel(app *sysl.Application, param Param) string
- func (p *Generator) CreateReturnDataModel(appname string, stmnt *sysl.Statement, endpoint *sysl.Endpoint) string
- func (p *Generator) CreateSequenceDiagram(appName string, endpoint *sysl.Endpoint) string
- func (p *Generator) CreateTypeDiagram(appName, typeName string, t *sysl.Type, recursive bool) string
- func (p *Generator) CreateTypeDiagramPlantUml(appName, typeName, typeAlias string, t *sysl.Type, recursive bool) string
- func (p *Generator) GenerateDataModel(app *sysl.Application) string
- func (p *Generator) GetFuncMap() template.FuncMap
- func (p *Generator) GetParamType(app *sysl.Application, param *sysl.Param) *sysl.Type
- func (p *Generator) GetReturnType(endpoint *sysl.Endpoint, stmnt *sysl.Statement) *sysl.Type
- func (p *Generator) ModuleAsMacroPackage(m *sysl.Module) map[string]*sysl.Module
- func (p *Generator) ModuleAsPackages(m *sysl.Module) map[string]*sysl.Module
- func (p *Generator) PlantumlInterceptor(content string, path ...string) string
- type Namer
- type Param
- type SourceCoder
- type Typer
Constants ¶
const AllInOneTemplate = `` /* 5513-byte string literal not displayed */
const EndTags = `</div>
</body>
</html>`
const GithubStyle = `` /* 3020-byte string literal not displayed */
const Header = `` /* 171-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func CreateFileName ¶
CreateFileName returns the absolute and relative filepaths
func CreateSequenceDiagram ¶
CreateSequenceDiagram creates an sequence diagram and returns the sequence diagram string and any errors
func GetAppPackageName ¶
GetAppPackageName returns the package and app name of any sysl application
func GetAppTypeName ¶
GetAppTypeName takes a Sysl Type and returns the appName and typeName of a param If the type is a primitive, the appName returned is "primitive"
func ModulePackageName ¶
func NewTypeRef ¶
NewTypeRef returns a type reference, needed to correctly generate data model diagrams
func PlantUMLURL ¶
PlantUMLURL returns a PlantUML url
func SanitiseOutputName ¶
SanitiseOutputName removes characters so that the string can be used as a hyperlink.
func ServiceMetadata ¶
func SortedKeys ¶
func SortedKeys(m interface{}) []string
func TernaryOperator ¶
func TernaryOperator(condition bool, i ...interface{}) interface{}
TernaryOperator returns the first element if bool is true and the second element is false
Types ¶
type Generator ¶
type Generator struct { RootModule *sysl.Module SourceFileName string ProjectTitle string PlantumlService string Interceptor func(string, ...string) string Log *logrus.Logger }
Generator is the contextual object that is used in the markdown generation
func NewProject ¶
func NewProject( titleAndFileName, plantumlService string, logger *logrus.Logger, module *sysl.Module) *Generator
NewProject generates a Generator object, fs and outputDir are optional if being used for a web server.
func NewProjectFromJson ¶
func NewProjectFromJson( titleAndFileName, plantumlService string, logger *logrus.Logger, module []byte) *Generator
NewProjectFromJson generates a generator object with a json byte input (of a sysl module) instead of a sysl module
func (*Generator) CreateIntegrationDiagram ¶
CreateIntegrationDiagram creates an integration diagram and returns the filename
func (*Generator) CreateParamDataModel ¶
func (p *Generator) CreateParamDataModel(app *sysl.Application, param Param) string
CreateParamDataModel creates a parameter data model and returns a filename
func (*Generator) CreateReturnDataModel ¶
func (p *Generator) CreateReturnDataModel(appname string, stmnt *sysl.Statement, endpoint *sysl.Endpoint) string
CreateReturnDataModel creates a return data model and returns a filename, or empty string if it wasn't a return statement.
func (*Generator) CreateSequenceDiagram ¶
CreateSequenceDiagram creates an sequence diagram and returns the filename
func (*Generator) CreateTypeDiagram ¶
func (*Generator) CreateTypeDiagramPlantUml ¶
func (*Generator) GenerateDataModel ¶
func (p *Generator) GenerateDataModel(app *sysl.Application) string
GenerateDataModel generates a data model for all of the types in app
func (*Generator) GetFuncMap ¶
GetFuncMap returns the funcs that are used in diagram generation.
func (*Generator) GetParamType ¶
GetReturnType converts an application and a param into a type, useful for getting attributes.
func (*Generator) GetReturnType ¶
GetReturnType converts an endpoint and a statement into a type, useful for getting attributes.
func (*Generator) ModuleAsMacroPackage ¶
func (*Generator) ModuleAsPackages ¶
ModuleAsPackages returns a map of [packagename]*sysl.Module
type SourceCoder ¶
type SourceCoder interface { Attr }