golang

package
v0.0.0-...-989111b Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeEllipsis

func DeEllipsis(ellipsisName, doc string) string

DeEllipsis replaces a ... with the according text.

func Format

func Format(source []byte) ([]byte, error)

Format tries to apply the gofmt rules to the given text. If it fails the error is returned and the string contains the text with line enumeration.

func MakeIdentifier

func MakeIdentifier(str string) string

MakeIdentifier creates a public name out of the given string. If it just contains rubbish, at worst the empty name _ is returned. - and _ are turned into upper case letters if possible.

func MakePrivate

func MakePrivate(str string) string

MakePrivate converts ABc to aBc. Special cases:

  • ID becomes id

func MakePublic

func MakePublic(str string) string

MakePublic converts aBc to ABc. Special cases:

  • id becomes ID

func WithLineNumbers

func WithLineNumbers(text string) string

WithLineNumbers puts a 1 based line number to the left and returns the text.

Types

type Options

type Options struct {
}

type RFile

type RFile struct {
	// contains filtered or unexported fields
}

func NewRFile

func NewRFile(parent *Renderer, pkg wdl.PkgImportQualifier) *RFile

func (*RFile) AddImport

func (r *RFile) AddImport(pkgName wdl.Identifier, path wdl.PkgImportQualifier)

func (*RFile) GoType

func (r *RFile) GoType(rtype *wdl.ResolvedType) string

func (*RFile) Use

func (r *RFile) Use(rtype *wdl.ResolvedType) *wdl.ResolvedType

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer provides a go renderer.

func NewRenderer

func NewRenderer(opts Options) *Renderer

NewRenderer creates a new Renderer instance.

func (*Renderer) RenderFile

func (r *Renderer) RenderFile(file *wdl.File) ([]byte, error)

RenderFile generates the code for the entire file.

Jump to

Keyboard shortcuts

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