gen

package
v0.0.0-...-ba3a32b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT, Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitFileCompletion

func EmitFileCompletion(w io.Writer, ts schema.TypeSystem, c *config) error

EmitFileCompletion templates deferred definitions run at `init()` time.

func EmitFileHeader

func EmitFileHeader(w io.Writer, pkg, tsPkg string, c *config)

EmitFileHeader templates the start of the schema.go generated content.

func EmitList

func EmitList(t *schema.TypeList, w io.Writer, c *config)

EmitList generates the code for a list type

func EmitMap

func EmitMap(t *schema.TypeMap, w io.Writer, c *config)

EmitMap generates a map type schema

func EmitScalar

func EmitScalar(t schema.Type, w io.Writer, c *config)

EmitScalar defines a scalar type for custom scalars in the type system.

func EmitStruct

func EmitStruct(t *schema.TypeStruct, w io.Writer, c *config)

EmitStruct generates the definition of a struct type.

func EmitUnion

func EmitUnion(t *schema.TypeUnion, w io.Writer, c *config)

EmitUnion emits the template for a union type

func Generate

func Generate(pth string, pkg string, ts schema.TypeSystem, tsPkgName, tsPkgPath string) error

Generate creates `schema.go` at `pth` (with go package `pkg`) that represents a graphql schema of the `ts` schema. The generated code will expect the schema also has been turned into a golang schema using the go-ipld-prime code generation, and that the generated golang schema can be referenced as `tsPkgName` at `tsPkgPath`.

func GetPreExistingMethods

func GetPreExistingMethods(dst string) map[string]struct{}

GetPreExistingMethods returns a list of non-schema-generated symbols in a destination go package

Types

This section is empty.

Directories

Path Synopsis
Code generated for package tmplgen by go-bindata DO NOT EDIT.
Code generated for package tmplgen by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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