target

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package target provides experimental dynamic target resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap returns placeholders for target template helpers.

func Stage

func Stage() partial.RenderStage

Stage gives templates the target helpers and applies configured target resolvers. The helpers are made only for the templates that call them.

func TargetHeader

func TargetHeader(ctx ...*partial.RenderContext) string

TargetHeader returns the connector target header name.

go-doc:sig func() string

func TargetIs

func TargetIs(values ...string) bool

TargetIs reports whether the current target matches any provided value.

go-doc:sig func(values ...string) bool

func TargetValue

func TargetValue(ctx ...*partial.RenderContext) string

TargetValue returns the current target value from the request.

go-doc:sig func() string

func WithResolver

func WithResolver(p *partial.Partial, resolver Resolver) *partial.Partial

WithResolver configures a partial-level target resolver.

Types

type Resolver

type Resolver func(ctx context.Context, r *http.Request, target string) (*partial.Partial, bool)

Resolver resolves a connector target name to a partial.

Jump to

Keyboard shortcuts

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