quicktemplate: github.com/valyala/quicktemplate Index | Files | Directories

package quicktemplate

import "github.com/valyala/quicktemplate"

Package quicktemplate provides fast and powerful template engine.

See https://github.com/valyala/quicktemplate for details.

Index

Package Files

bytebuffer.go doc.go htmlescapewriter.go jsonstring.go urlencode.go util.go util_noappengine.go writer.go

func ReleaseByteBuffer Uses

func ReleaseByteBuffer(b *ByteBuffer)

ReleaseByteBuffer retruns byte buffer to the pool.

Do not access byte buffer after returning it to the pool, otherwise data races may occur.

func ReleaseWriter Uses

func ReleaseWriter(qw *Writer)

ReleaseWriter returns the writer to the pool.

Do not access released writer, otherwise data races may occur.

type ByteBuffer Uses

type ByteBuffer bytebufferpool.ByteBuffer

ByteBuffer implements io.Writer on top of byte slice.

Recycle byte buffers via AcquireByteBuffer and ReleaseByteBuffer in order to reduce memory allocations.

Deprecated: use github.com/valyala/bytebufferpool instead.

func AcquireByteBuffer Uses

func AcquireByteBuffer() *ByteBuffer

AcquireByteBuffer returns new ByteBuffer from the pool.

Return unneeded buffers to the pool by calling ReleaseByteBuffer in order to reduce memory allocations.

func (*ByteBuffer) Reset Uses

func (b *ByteBuffer) Reset()

Reset resets the byte buffer.

func (*ByteBuffer) Write Uses

func (b *ByteBuffer) Write(p []byte) (int, error)

Write implements io.Writer.

type QWriter Uses

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

QWriter is auxiliary writer used by Writer.

func (*QWriter) D Uses

func (w *QWriter) D(n int)

D writes n to w.

func (*QWriter) F Uses

func (w *QWriter) F(f float64)

F writes f to w.

func (*QWriter) FPrec Uses

func (w *QWriter) FPrec(f float64, prec int)

FPrec writes f to w using the given floating point precision.

func (*QWriter) J Uses

func (w *QWriter) J(s string)

J writes json-safe s to w.

Unlike Q it doesn't qoute resulting s.

func (*QWriter) JZ Uses

func (w *QWriter) JZ(z []byte)

JZ writes json-safe z to w.

Unlike Q it doesn't qoute resulting z.

func (*QWriter) Q Uses

func (w *QWriter) Q(s string)

Q writes quoted json-safe s to w.

func (*QWriter) QZ Uses

func (w *QWriter) QZ(z []byte)

QZ writes quoted json-safe z to w.

func (*QWriter) Reset Uses

func (w *QWriter) Reset()

Reset resets QWriter to the original state.

func (*QWriter) S Uses

func (w *QWriter) S(s string)

S writes s to w.

func (*QWriter) SZ Uses

func (w *QWriter) SZ(z []byte)

SZ is a synonym to Z.

func (*QWriter) U Uses

func (w *QWriter) U(s string)

U writes url-encoded s to w.

func (*QWriter) UZ Uses

func (w *QWriter) UZ(z []byte)

UZ writes url-encoded z to w.

func (*QWriter) V Uses

func (w *QWriter) V(v interface{})

V writes v to w.

func (*QWriter) Write Uses

func (w *QWriter) Write(p []byte) (int, error)

Write implements io.Writer.

func (*QWriter) Z Uses

func (w *QWriter) Z(z []byte)

Z writes z to w.

type Writer Uses

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

Writer implements auxiliary writer used by quicktemplate functions.

Use AcquireWriter for creating new writers.

func AcquireWriter Uses

func AcquireWriter(w io.Writer) *Writer

AcquireWriter returns new writer from the pool.

Return unneeded writer to the pool by calling ReleaseWriter in order to reduce memory allocations.

func (*Writer) E Uses

func (qw *Writer) E() *QWriter

E returns QWriter with enabled html escaping.

func (*Writer) N Uses

func (qw *Writer) N() *QWriter

N returns QWriter without html escaping.

func (*Writer) W Uses

func (qw *Writer) W() io.Writer

W returns the underlying writer passed to AcquireWriter.

Directories

PathSynopsis
examples/basicserverThe following line is needed for generating go code from templates with `go generate`.
examples/basicserver/templates
qtcCommand qtc is a compiler for quicktemplate files.
testsPackage tests contains tests for quicktemplate

Package quicktemplate imports 9 packages (graph) and is imported by 28 packages. Updated 2018-11-27. Refresh now. Tools for package owners.