golang

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Key      string   `json:"key"`
	Type     string   `json:"type"`
	Lines    []string `json:"lines"`
	SkipDecl bool     `json:"skipDecl,omitempty"`
	Lints    []string `json:"lints,omitempty"`
}

func NewBlock

func NewBlock(k string, t string) *Block

func (*Block) ContainsText added in v0.10.32

func (b *Block) ContainsText(s string) bool

func (*Block) LineComplexity added in v0.10.32

func (b *Block) LineComplexity() int

func (*Block) LineCount added in v0.10.32

func (b *Block) LineCount() int

func (*Block) LineMaxLength added in v0.10.32

func (b *Block) LineMaxLength() int

func (*Block) NoLineDecl added in v0.10.32

func (b *Block) NoLineDecl(linebreak string) (string, error)

func (*Block) Render

func (b *Block) Render(linebreak string) (string, error)

func (*Block) W

func (b *Block) W(l string)

func (*Block) WA added in v1.5.9

func (b *Block) WA(a ...string)

func (*Block) WB added in v0.9.7

func (b *Block) WB()

func (*Block) WE added in v0.9.7

func (b *Block) WE(indent int, prefix ...string)

func (*Block) WF added in v1.5.18

func (b *Block) WF(l string, args ...any)

type Blocks

type Blocks []*Block

type File

type File struct {
	Package string        `json:"package,omitempty"`
	Path    []string      `json:"path,omitempty"`
	Name    string        `json:"name"`
	Imports model.Imports `json:"imports"`
	Blocks  Blocks        `json:"blocks"`
}

func NewFile

func NewFile(pkg string, path []string, fn string) *File

func (*File) AddBlocks

func (f *File) AddBlocks(b ...*Block)

func (*File) AddImport

func (f *File) AddImport(i ...*model.Import)

func (*File) Render

func (f *File) Render(linebreak string) (*file.File, error)

type Template

type Template struct {
	Path    []string      `json:"path,omitempty"`
	Name    string        `json:"name"`
	Imports model.Imports `json:"imports"`
	Blocks  Blocks        `json:"blocks"`
}

func NewGoTemplate

func NewGoTemplate(path []string, fn string) *Template

func (*Template) AddBlocks

func (f *Template) AddBlocks(b ...*Block)

func (*Template) AddImport

func (f *Template) AddImport(i ...*model.Import)

func (*Template) Render

func (f *Template) Render(linebreak string) (*file.File, error)

Jump to

Keyboard shortcuts

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