hero: github.com/shiyanhui/hero Index | Files | Directories

package hero

import "github.com/shiyanhui/hero"

Index

Package Files

bufferpool.go doc.go generator.go parser.go sort.go util.go

Constants

const (
    TypeBytesBuffer = "bytes.Buffer"
    TypeIOWriter    = "io.Writer"
)
const (
    TypeImport = iota
    TypeDefinition
    TypeExtend
    TypeInclude
    TypeBlock
    TypeCode
    TypeEscapedValue
    TypeRawValue
    TypeNote
    TypeHTML
    TypeRoot
)
const (
    Bool      = "b"
    Int       = "i"
    Uint      = "u"
    Float     = "f"
    String    = "s"
    Bytes     = "bs"
    Interface = "v"
)
const (
    OpenBrace   = '{'
    CloseBrace  = '}'
    LT          = '<'
    GT          = '>'
    Percent     = '%'
    Exclamation = '!'
    Colon       = ':'
    Tilde       = '~'
    Plus        = '+'
    Equal       = '='
    At          = '@'
    Pound       = '#'
    Space       = ' '
    BreakLine   = '\n'
)

func CheckExtension Uses

func CheckExtension(path string, extensions []string) bool

func EscapeHTML Uses

func EscapeHTML(html string, buffer *bytes.Buffer)

EscapeHTML escapes the html and then put it to the buffer.

func FormatBool Uses

func FormatBool(b bool, buffer *bytes.Buffer)

FormatBool format bool to string and then put the result to the buffer.

func FormatFloat Uses

func FormatFloat(f float64, buffer *bytes.Buffer)

FormatFloat format float64 to string and then put the result to the buffer.

func FormatInt Uses

func FormatInt(i int64, buffer *bytes.Buffer)

FormatInt format int to string and then put the result to the buffer.

func FormatUint Uses

func FormatUint(u uint64, buffer *bytes.Buffer)

FormatUint formats uint to string and put it to the buffer. It's part of go source: https://github.com/golang/go/blob/master/src/strconv/itoa.go#L60

func Generate Uses

func Generate(source, dest, pkgName string, extensions []string)

Generate generates Go code from source to test. pkgName represents the package name of the generated code.

func GetBuffer Uses

func GetBuffer() *bytes.Buffer

GetBuffer returns a *bytes.Buffer from sync.Pool.

func PutBuffer Uses

func PutBuffer(buffer *bytes.Buffer)

PutBuffer puts a *bytes.Buffer to the sync.Pool.

Directories

PathSynopsis
examples/app
examples/app/templateCode generated by hero.
hero

Package hero imports 16 packages (graph) and is imported by 7 packages. Updated 2019-07-27. Refresh now. Tools for package owners.