Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Template ¶
type Template[T any] struct { // contains filtered or unexported fields }
Template provides template execution and data embedding/extraction capabilities. It is parameterized by type T which represents the data type to be embedded/extracted.
func New ¶
New creates a new Template instance with the specified identity, markerSuffix, and entityType. The identity distinguishes between different manager instances. The markerSuffix differentiates between different entity types (e.g., "-pr-data" or "-issue-data"). The entityType is used in error messages (e.g., "PR" or "issue"). Returns an error if identity validation fails or regex compilation fails.
func (*Template[T]) Embed ¶
Embed embeds the given data as JSON in HTML comments within the body. The embedded data is placed at the end of the body using the configured marker.