advantages

package
v0.0.0-...-40e1022 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animal

type Animal struct {
}

type Cache

type Cache interface {
	Get(ID int) *Animal
	Put(ID int, value *Animal)
}

type CarV1

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

func (*CarV1) Drive

func (c *CarV1) Drive()

type CarV2

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

func (*CarV2) Drive

func (c *CarV2) Drive()

type Datastore

type Datastore interface {
	Load(ID int) (*Animal, error)
	Save(ID int, value *Animal) error
}

type DefaultRenderer

type DefaultRenderer struct{}

Default implementation of Storage

func (*DefaultRenderer) Render

func (d *DefaultRenderer) Render(template io.Reader, params ...interface{}) []byte

Load implements Renderer

type DefaultStorage

type DefaultStorage struct{}

Default implementation of Storage

func (*DefaultStorage) Load

func (d *DefaultStorage) Load() []interface{}

Load implements Storage

type Engine

type Engine interface {
	Start()
	Drive()
	Stop()
}

type Generator

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

func NewGenerator

func NewGenerator(storage Storage, renderer Renderer, template io.Reader) *Generator

func NewGeneratorV2

func NewGeneratorV2(template io.Reader) *Generator

func (*Generator) Generate

func (g *Generator) Generate(destination io.Writer, params ...interface{})

type LoaderWithJIT

type LoaderWithJIT struct {

	// optional cache
	OptionalCache Cache
	// contains filtered or unexported fields
}

func NewLoaderWithJIT

func NewLoaderWithJIT(ds Datastore) *LoaderWithJIT

func (*LoaderWithJIT) Load

func (l *LoaderWithJIT) Load(ID int) (*Animal, error)

type LoaderWithoutJIT

type LoaderWithoutJIT struct {

	// optional cache
	OptionalCache Cache
	// contains filtered or unexported fields
}

func NewLoaderWithoutJIT

func NewLoaderWithoutJIT(ds Datastore) *LoaderWithoutJIT

func (*LoaderWithoutJIT) Load

func (l *LoaderWithoutJIT) Load(ID int) (*Animal, error)

type MyLoader

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

func NewLoader

func NewLoader(ds Datastore, cache Cache) *MyLoader

func (*MyLoader) LoadAll

func (l *MyLoader) LoadAll() ([]interface{}, error)

type Renderer

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

type Storage

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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