generator

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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