est

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 2 modules, 1 package

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

View Source
var EmptyStringPtr = unsafe.Pointer(&emptyString)
View Source
var FalseValuePtr = unsafe.Pointer(&falseValue)
View Source
var TrueValuePtr = unsafe.Pointer(&trueValue)
View Source
var ZeroFloatPtr = unsafe.Pointer(&zeroFloat)
View Source
var ZeroIntPtr = unsafe.Pointer(&zeroInt)

Functions

This section is empty.

Types

type Buffer

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

func NewBuffer

func NewBuffer(size int, escape bool) *Buffer

func (*Buffer) AppendBool

func (b *Buffer) AppendBool(v bool)

func (*Buffer) AppendByte

func (b *Buffer) AppendByte(bs byte)

func (*Buffer) AppendFloat

func (b *Buffer) AppendFloat(v float64)

func (*Buffer) AppendInt

func (b *Buffer) AppendInt(v int)

func (*Buffer) AppendString

func (b *Buffer) AppendString(s string)

func (*Buffer) AppendStringWithoutEscaping added in v0.2.0

func (b *Buffer) AppendStringWithoutEscaping(s string)

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) String

func (b *Buffer) String() string

type Compute

type Compute func(state *State) unsafe.Pointer

type Computers

type Computers []New

func (Computers) New

func (c Computers) New(control Control) ([]Compute, error)

type Control

type Control uint8

Control represents execution control flags like uses continue, uses break

const (
	// ControlHasBreak marks templates that include break statements.
	ControlHasBreak Control = 1 << iota
	// ControlInLoop marks a scope that is inside #for/#foreach.
	ControlInLoop
)

func (Control) HasBreak added in v0.4.0

func (c Control) HasBreak() bool

func (Control) InLoop added in v0.4.0

func (c Control) InLoop() bool

type Execution

type Execution struct {
	PanicOnError bool
	// contains filtered or unexported fields
}

func NewExecution

func NewExecution(compute Compute) *Execution

func (*Execution) Exec

func (e *Execution) Exec(stat *State) (err error)

func (*Execution) ExecWithContext added in v0.3.0

func (e *Execution) ExecWithContext(ctx context.Context, stat *State) error

ExecWithContext executes with the provided context set on the state. Backward compatible: underlying Exec is invoked after setting state context.

type New

type New func(control Control) (Compute, error)

type State

type State struct {
	sync.Mutex
	Mem          interface{}
	MemPtr       unsafe.Pointer
	StateType    *Type
	Buffer       *Buffer
	Errors       []error
	PanicOnError bool

	Ctx context.Context
	// contains filtered or unexported fields
}

func (*State) AddError added in v0.2.0

func (s *State) AddError(err error)

func (*State) ConsumeBreak added in v0.4.0

func (s *State) ConsumeBreak()

func (*State) Context added in v0.3.0

func (s *State) Context() context.Context

func (*State) EmbedValue added in v0.2.0

func (s *State) EmbedValue(v interface{}) error

func (*State) HasBreak added in v0.4.0

func (s *State) HasBreak() bool

func (*State) IsValid added in v0.2.0

func (s *State) IsValid() bool

func (*State) RequestBreak added in v0.4.0

func (s *State) RequestBreak()

func (*State) Reset

func (s *State) Reset()

func (*State) SetContext added in v0.3.0

func (s *State) SetContext(ctx context.Context)

func (*State) SetValue

func (s *State) SetValue(k string, v interface{}) error

func (*State) Take added in v0.2.0

func (s *State) Take() bool

type TemplateError added in v0.2.0

type TemplateError error

type Type added in v0.2.0

type Type struct {
	reflect.Type
	// contains filtered or unexported fields
}

Type represents scope type

func NewType added in v0.2.0

func NewType() *Type

func (*Type) AddField added in v0.2.0

func (t *Type) AddField(id string, name string, rType reflect.Type) reflect.StructField

func (*Type) AddFieldWithTag added in v0.2.0

func (t *Type) AddFieldWithTag(id string, name, tag string, rType reflect.Type) reflect.StructField

func (*Type) AnonymousHolder added in v0.2.0

func (t *Type) AnonymousHolder(rType reflect.Type) (string, bool)

func (*Type) EmbedType added in v0.2.0

func (t *Type) EmbedType(rType reflect.Type) reflect.StructField

func (*Type) ReserveNewName added in v0.2.0

func (t *Type) ReserveNewName() string

func (*Type) Snapshot added in v0.2.0

func (t *Type) Snapshot() *Type

func (*Type) ValueAccessor added in v0.2.0

func (t *Type) ValueAccessor(id string) (*xunsafe.Field, bool)

func (*Type) ValueAccessors added in v0.2.0

func (t *Type) ValueAccessors() []*xunsafe.Field

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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