template

package
v0.1.931 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FuncDerefString = "derefString"
	FuncLink        = "link"
)

Variables

This section is empty.

Functions

func DefaultFuncMap added in v0.1.389

func DefaultFuncMap() template.FuncMap

DefaultFuncMap returns the default template function map.

func DerefString added in v0.1.389

func DerefString(s *string) string

DerefString returns the string value or empty if nil.

func Link(server, file string) string

Link returns a joined URL from server and file.

Types

type Blackbox

type Blackbox interface {
	// contains filtered or unexported methods
}

type Client

type Client interface {
	Blackbox
	contract.TemplateOperator
}

func NewClient

func NewClient(opts ClientOptions) (Client, error)

type ClientOption

type ClientOption = contract.Opt[ClientOptions]

func WithTemplatesFS

func WithTemplatesFS(x fs.FS) ClientOption

func WithTemplatesPath

func WithTemplatesPath(x string) ClientOption

type ClientOptions

type ClientOptions struct {
	TemplatesFS   fs.FS
	TemplatesPath string
}

func ApplyClientOptions

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) Render

func (d *DefaultTool) Render(ctx context.Context, opts contract.RenderOptions) error

Render renders a template with the given options.

type Tool

type Tool interface {
	contract.TemplateOperator
}

Jump to

Keyboard shortcuts

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