stereotype

package
v0.0.0-...-797e501 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocDevelop = "getting-started/development.md"
)

Variables

This section is empty.

Functions

func FindCMDPkgs

func FindCMDPkgs(n ast.Node) []*ast.Pkg

FindCMDPkgs returns all annotated CMDPkg.

func WithPkg

func WithPkg(n ast.Node, f func(pkg Pkg) error) error

WithPkg visits recursively all Pkg elements.

Types

type Docs

type Docs struct {
	Files map[string][]doc.Node
	// contains filtered or unexported fields
}

func Doc

func Doc(m *ast.Mod, lang, suffix string, node ...doc.Node) *Docs

func (*Docs) Append

func (d *Docs) Append(path string, node ...doc.Node) *Docs

func (*Docs) Doc

func (d *Docs) Doc(suffix string, node ...doc.Node) *Docs

Doc appends the given nodes as a default language (EN) boxed into a module specific documentation path, so that later all module documentations can easily be merged into an uber-documentation.

func (*Docs) DocWithLang

func (d *Docs) DocWithLang(lang, suffix string, node ...doc.Node) *Docs

func (*Docs) Prefix

func (d *Docs) Prefix(lang string) string

Prefix returns the language and module specific prefix path.

type Field

type Field struct {
	// contains filtered or unexported fields
}

Field contains all stereotype annotations for single field instances.

func FieldFrom

func FieldFrom(field *ast.Field) Field

func (Field) EnvironmentVariable

func (c Field) EnvironmentVariable() (string, bool)

EnvironmentVariable extracts the environment variable.

func (Field) IsProgramFlag

func (c Field) IsProgramFlag() bool

IsProgramFlag returns true if this field is a command line flag candidate.

func (Field) ProgramFlagVariable

func (c Field) ProgramFlagVariable() (string, bool)

ProgramFlagVariable extracts the program flag variable.

func (Field) SQLColumnName

func (c Field) SQLColumnName() (string, bool)

SQLColumnName extracts the sql column name.

func (Field) SetEnvironmentVariable

func (c Field) SetEnvironmentVariable(environmentVariable string)

SetEnvironmentVariable connects the given field with a specific name from the environment variable.

func (Field) SetProgramFlag

func (c Field) SetProgramFlag(b bool)

SetProgramFlag marks this field as a command line flag candidate.

func (Field) SetProgramFlagVariable

func (c Field) SetProgramFlagVariable(flagVariable string)

SetProgramFlagVariable connects the given field with a specific name from the program flag variable.

func (Field) SetSQLColumnName

func (c Field) SetSQLColumnName(tableName string) Field

SetSQLColumnName sets an sql column name.

func (Field) Unwrap

func (c Field) Unwrap() *ast.Field

type Mod

type Mod struct {
	// contains filtered or unexported fields
}

Mod contains all stereotype annotations for a module instance.

func ModFrom

func ModFrom(mod *ast.Mod) Mod

func (Mod) Docs

func (c Mod) Docs() *Docs

func (Mod) Ident

func (c Mod) Ident() string

Ident returns a unique identifier for the module or the empty string.

func (Mod) ProjectIdent

func (c Mod) ProjectIdent() string

ProjectIdent returns a unique identifier for the module or the empty string.

func (Mod) SetIdent

func (c Mod) SetIdent(ident string)

func (Mod) SetProjectIdent

func (c Mod) SetProjectIdent(ident string)

func (Mod) Unwrap

func (c Mod) Unwrap() *ast.Mod

type Pkg

type Pkg struct {
	// contains filtered or unexported fields
}

Pkg contains all stereotype annotations for a package instance.

func PkgFrom

func PkgFrom(pkg *ast.Pkg) Pkg

func (Pkg) FindStructs

func (c Pkg) FindStructs(predicate func(s Struct) bool) []*ast.Struct

FindStructs applies the predicate on each contained struct. However, only non-raw types can be inspected.

func (Pkg) IsCMDPkg

func (c Pkg) IsCMDPkg() bool

IsCMDPkg returns only true, if the package shall be main package.

func (Pkg) SetIsCMDPkg

func (c Pkg) SetIsCMDPkg(isPublicConfig bool) Pkg

SetIsCMDPkg marks this package a main package.

func (Pkg) Unwrap

func (c Pkg) Unwrap() *ast.Pkg

type Struct

type Struct struct {
	// contains filtered or unexported fields
}

func StructFrom

func StructFrom(obj *ast.Struct) Struct

func (Struct) IsConfiguration

func (s Struct) IsConfiguration() bool

IsConfiguration returns only true, if this struct shall be used as a configurational object.

func (Struct) IsDatabaseConfiguration

func (s Struct) IsDatabaseConfiguration() bool

IsDatabaseConfiguration returns only true, if this struct shall be used as a configurational object.

func (Struct) IsService

func (s Struct) IsService() bool

IsService returns only true, if this struct shall be used as a service object.

func (Struct) MySQLRelated

func (s Struct) MySQLRelated() bool

MySQLRelated returns only true, if this struct is mysql related.

func (Struct) SQLDefaultOrder

func (s Struct) SQLDefaultOrder() (string, bool)

SQLDefaultOrder extracts the sql entity default order.

func (Struct) SQLTableName

func (s Struct) SQLTableName() (string, bool)

SQLTableName extracts the sql table name.

func (Struct) SetIsConfiguration

func (s Struct) SetIsConfiguration(isPublicConfig bool) Struct

SetIsConfiguration marks this struct as a public configuration object. It provides environmental and program flags.

func (Struct) SetIsDatabaseConfiguration

func (s Struct) SetIsDatabaseConfiguration(isDbConfig bool) Struct

SetIsDatabaseConfiguration marks this struct as a public configuration object. It provides environmental and program flags.

func (Struct) SetIsService

func (s Struct) SetIsService(isPublicConfig bool) Struct

SetIsService marks this struct as a public service component.

func (Struct) SetMySQLRelated

func (s Struct) SetMySQLRelated(isDbConfig bool) Struct

SetMySQLRelated marks this struct as mysql related.

func (Struct) SetSQLDefaultOrder

func (s Struct) SetSQLDefaultOrder(orderBy string) Struct

SetSQLDefaultOrder declares a default sort order. E.g. ORDER BY col1 ASC, col2 DESC

func (Struct) SetSQLTableName

func (s Struct) SetSQLTableName(tableName string) Struct

SetSQLTableName sets an sql table name

Jump to

Keyboard shortcuts

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