disadvantages

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	Format([]byte) []byte
}

type Generator

type Generator struct{}

func (*Generator) Generate

func (g *Generator) Generate(storage Storage, template io.Reader, destination io.Writer, renderer Renderer, formatter Formatter, params ...interface{})

type GeneratorV2

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

func NewGeneratorV2

func NewGeneratorV2(storage Storage, renderer Renderer, formatter Formatter) *GeneratorV2

func (*GeneratorV2) Generate

func (g *GeneratorV2) Generate(template io.Reader, destination io.Writer, params ...interface{})

type MyPersonLoader

type MyPersonLoader interface {
	Load(ID int) (*Person, error)
}

type Person

type Person struct {
	Name string
	Age  int
}

type PersonLoader

type PersonLoader struct {
}

Load people from the database

func (*PersonLoader) Load

func (d *PersonLoader) Load(db *sql.DB, ID int) (*Person, error)

func (*PersonLoader) LoadAll

func (d *PersonLoader) LoadAll(db *sql.DB) ([]*Person, error)

type Renderer

type Renderer interface {
	Render(template io.Reader, params ...interface{}) []byte
}

type Storage

type Storage interface {
	Load() []interface{}
}

Jump to

Keyboard shortcuts

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