Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderSchema ¶
RenderStrings builds a string representation of a type result using the given pre, path, and post functions.
Types ¶
type Options ¶
type Options struct {
// DeReference converts TypeRefID to their included types.
// - If TyepRefs have a cyclical relationship, the last TypeRef is kept as a TypeRef.
DeReference bool
// Dialects uses dialect resolution to override defaults.
// - May be overridden or ignored by renderers.
Dialects []string
// IncludeNative includes details on native types if set.
// - May be overridden or ignored by renderers.
IncludeNative bool
// Prefix is a string used as a prefix for indented lines.
Prefix string
// Indent is used for rendering where indent matters.
Indent int
}
func NewOptions ¶
func NewOptions() *Options
type Renderer ¶
type Renderer interface {
// ProcessResult starts the render process on a Schema and returns a slice of strings.
// - settings is one or more strings with options for specific processors.
ProcessSchema(schema *types.Schema, settings ...string) ([]string, error)
// DeReference returns true if schema references should be replaced with inline types.
DeReference() bool
// Indent returns the current indent value.
Indent() int
// SetIndent sets the indent to a given value.
SetIndent(value int)
// Prefix returns a prefix string with the current indent.
Prefix() string
// Pre and Post return strings before/after a type element's children are processed.
Pre(t *types.TypeNode) []string
Post(t *types.TypeNode) []string
// Path is a function that builds a path string from a TypeNode.
Path(t *types.TypeNode) []string
}
Click to show internal directories.
Click to hide internal directories.