writing

package
v0.0.0-...-cf35e54 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmptyString is an empty golang string
	EmptyString = "\"\""

	// Nil is nil
	Nil = "nil"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block func(url.Values) error

Block is a function callback that is used while generating golang control flow blocks.

type FuncDecl

type FuncDecl struct {
	Name    string
	Params  []FuncParam
	Returns []string
}

FuncDecl provides the structure of a golang function definition. ast.FuncDecl was too complex.

type FuncParam

type FuncParam struct {
	Type   string
	Symbol string
}

FuncParam represents the golang function parameter syntax

type GoWriter

type GoWriter interface {
	WritePackage(string)
	WriteImport(string)
	WriteCall(...string) error
	WithFunc(string, []FuncParam, []string, Block) error
	WithMethod(string, string, []FuncParam, []string, Block) error
	WithIf(string, Block, ...interface{}) error
	WithIter(string, Block, ...interface{}) error
	WithStruct(string, Block) error
	WithInterface(string, Block) error
	Returns(...string) error
	Println(string, ...interface{}) error
	Comment(string, ...interface{})
}

GoWriter defines an interface with a simple api for writing go code.

func NewGoWriter

func NewGoWriter(destination io.Writer) GoWriter

NewGoWriter returns an instance of the GoWriter interface which is useful for writing golang code.

type SingleQuotedStringList

type SingleQuotedStringList []string

SingleQuotedStringList will return itself as a comma delimited list of quoted strings when stringified.

func (SingleQuotedStringList) String

func (l SingleQuotedStringList) String() string

type StringSliceLiteral

type StringSliceLiteral []string

StringSliceLiteral will return itself as the golang literal syntax for string slices.

func (StringSliceLiteral) String

func (l StringSliceLiteral) String() string

Jump to

Keyboard shortcuts

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