template

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 15 Imported by: 0

README

template

Simple template system for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ASCII

func ASCII(s any, args ...any) (any, error)

func Bool

func Bool(value any) (bool, error)

func Center

func Center(s any, args ...any) (any, error)

func Delete

func Delete(s any, args ...any) (any, error)

func Fields

func Fields(s any, args ...any) (any, error)

func ID

func ID(s any, args ...any) (any, error)

func Int64

func Int64(value any) (int64, error)

func JustifyLeft

func JustifyLeft(s any, args ...any) (any, error)

func JustifyRight

func JustifyRight(s any, args ...any) (any, error)

func Key

func Key(s any, args ...any) (any, error)

func Kill

func Kill(s any, args ...any) (any, error)

func Latin1

func Latin1(s any, args ...any) (any, error)

func Lower

func Lower(s any, args ...any) (any, error)

func Lower1

func Lower1(s any, args ...any) (any, error)

func Partition

func Partition(s any, args ...any) (any, error)

func PartitionLast

func PartitionLast(s any, args ...any) (any, error)

func Prefix

func Prefix(s any, args ...any) (any, error)

func Repeat

func Repeat(s any, args ...any) (any, error)

func Replace

func Replace(s any, args ...any) (any, error)

func ReplaceRegexp

func ReplaceRegexp(s any, args ...any) (any, error)

func Reverse

func Reverse(s any, args ...any) (any, error)

func Squeeze

func Squeeze(s any, args ...any) (any, error)

func String

func String(value any) (string, error)

func SubString

func SubString(s any, args ...any) (any, error)

func Suffix

func Suffix(s any, args ...any) (any, error)

func SwapCase

func SwapCase(s any, args ...any) (any, error)

func Switch

func Switch(s any, args ...any) (any, error)

func Time

func Time(s any, args ...any) (any, error)

func ToBool

func ToBool(s any, args ...any) (any, error)

func ToCamelCase

func ToCamelCase(s any, args ...any) (any, error)

func ToInt

func ToInt(s any, args ...any) (any, error)

func ToKebabCase

func ToKebabCase(s any, args ...any) (any, error)

func ToSnakeCase

func ToSnakeCase(s any, args ...any) (any, error)

func ToString

func ToString(s any, args ...any) (any, error)

func Translate

func Translate(s any, args ...any) (any, error)

func Trim

func Trim(s any, args ...any) (any, error)

func TrimLeft

func TrimLeft(s any, args ...any) (any, error)

func TrimPrefix

func TrimPrefix(s any, args ...any) (any, error)

func TrimRight

func TrimRight(s any, args ...any) (any, error)

func TrimSpace

func TrimSpace(s any, args ...any) (any, error)

func TrimSpaceLeft

func TrimSpaceLeft(s any, args ...any) (any, error)

func TrimSpaceRight

func TrimSpaceRight(s any, args ...any) (any, error)

func TrimSuffix

func TrimSuffix(s any, args ...any) (any, error)

func URL

func URL(s any, args ...any) (any, error)

func Upper

func Upper(s any, args ...any) (any, error)

func Upper1

func Upper1(s any, args ...any) (any, error)

func XML

func XML(s any, args ...any) (any, error)

Types

type Template

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

func (*Template) Compile

func (t *Template) Compile(s string) (err error)

func (*Template) Eval

func (t *Template) Eval(placeholders map[string]any) (string, error)

func (*Template) GetID

func (t *Template) GetID() string

func (Template) MarshalJSON

func (t Template) MarshalJSON() ([]byte, error)

func (*Template) SetID

func (t *Template) SetID(id string)

func (*Template) SetStart

func (t *Template) SetStart(start int)

func (Template) String

func (t Template) String() string

type TemplateNature

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

func MakeTemplateNature

func MakeTemplateNature(verb string, data []string) (*TemplateNature, error)

type Transformation

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

func MakeTransformation

func MakeTransformation(keys map[string]any, stmpl any) (*Transformation, error)

Jump to

Keyboard shortcuts

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