generator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package generator abstracts writing specific Go constructs (interfaces, structs etc) into IO.

Package generator abstracts writing specific Go constructs (interfaces, structs etc) into IO.

Index

Constants

View Source
const GraphQLErrorStructName = "GraphQLError"

GraphQLErrorStructName - default name of the generated GraphQL error response struct.

View Source
const Header = "// Generated with grafik. DO NOT EDIT"

Header - default header added to the generated grafik client.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	WriteHeader()
	WritePackage(pkgName string)
	WriteImports()
	WriteLineBreak(r int)
	WriteInterface(name string, fn ...ds.Func)
	WritePublicStruct(s ds.Struct, usePointers bool)
	WritePrivateStruct(s ds.Struct)
	WriteEnum(e ds.Enum)
	WriteConst(c ds.Const)
	WriteClientConstructor(clientName string)
	WriteInterfaceImplementation(clientName string, f ds.Func)
	WriteGraphqlErrorStructs(usePointers bool)
	Generate() io.WriterTo
}

A Generator is an interface that provides contract for generator struct and is being used instead of a pointer.

func New

func New() Generator

New return instance of generator.

Jump to

Keyboard shortcuts

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