Documentation ¶
Index ¶
- func AppendDefinitionsIfNotExists(defs ast.DefinitionList, defsToAppend ...*ast.Definition) []*ast.Definition
- type OutputWriter
- type SchemaGenerator
- func (e *SchemaGenerator) GenerateOutput() error
- func (e *SchemaGenerator) WithFooter(footer string) *SchemaGenerator
- func (e *SchemaGenerator) WithHeader(header string) *SchemaGenerator
- func (e *SchemaGenerator) WithOutputWriter(outputWriter OutputWriter) *SchemaGenerator
- func (e *SchemaGenerator) WithPath(path string) *SchemaGenerator
- func (e *SchemaGenerator) WithSchemaHooks(schemaHooks ...SchemaHook) *SchemaGenerator
- type SchemaHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDefinitionsIfNotExists ¶
func AppendDefinitionsIfNotExists(defs ast.DefinitionList, defsToAppend ...*ast.Definition) []*ast.Definition
Types ¶
type OutputWriter ¶
type OutputWriter func(*ast.Schema, *ast.SchemaDocument) error
OutputWriter is a function that can be used to write the schema to a custom output.
type SchemaGenerator ¶
type SchemaGenerator struct {
// contains filtered or unexported fields
}
SchemaGenerator is a struct that can be used to generate a schema from a list of schema hooks. The schema can then be written to a file or a custom output.
func NewSchemaGenerator ¶
func NewSchemaGenerator() *SchemaGenerator
func (*SchemaGenerator) GenerateOutput ¶
func (e *SchemaGenerator) GenerateOutput() error
GenerateOutput generates the schema and writes it to the given path.
func (*SchemaGenerator) WithFooter ¶
func (e *SchemaGenerator) WithFooter(footer string) *SchemaGenerator
func (*SchemaGenerator) WithHeader ¶
func (e *SchemaGenerator) WithHeader(header string) *SchemaGenerator
func (*SchemaGenerator) WithOutputWriter ¶
func (e *SchemaGenerator) WithOutputWriter(outputWriter OutputWriter) *SchemaGenerator
func (*SchemaGenerator) WithPath ¶
func (e *SchemaGenerator) WithPath(path string) *SchemaGenerator
func (*SchemaGenerator) WithSchemaHooks ¶
func (e *SchemaGenerator) WithSchemaHooks(schemaHooks ...SchemaHook) *SchemaGenerator
type SchemaHook ¶
type SchemaHook func(*ast.SchemaDocument) error
SchemaHook is a function that can be used to modify the schema before it is
Click to show internal directories.
Click to hide internal directories.