Documentation
¶
Overview ¶
Package template provides template storage and retrieval for the Gas ecosystem with in-memory, directory, database, filesystem, and composite backends in the memory, dir, db, fs, and composite sub-packages.
See the module README for usage examples and design rationale.
SPDX-License-Identifier: MIT
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTemplateNotFound is returned by Get when the requested template // does not exist. ErrTemplateNotFound = errors.New("template: not found") // ErrReadOnly is returned by Register and RegisterFS on read-only // providers (e.g. the fs backend). Wrap such providers in a composite // store with a writable provider if mutation is required. ErrReadOnly = errors.New("template: read-only provider") )
Sentinel errors returned by TemplateProvider implementations.
Functions ¶
func IsNotFound ¶
IsNotFound returns true if the given error is an ErrTemplateNotFound. Useful for callers that need to distinguish "not found" from other errors.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fs provides a read-only template store backed by an fs.FS, suitable for use with embed.FS or any other fs.FS implementation.
|
Package fs provides a read-only template store backed by an fs.FS, suitable for use with embed.FS or any other fs.FS implementation. |
|
internal
|
|
|
Package templatetest provides a mock implementation of gas.TemplateProvider for use in tests.
|
Package templatetest provides a mock implementation of gas.TemplateProvider for use in tests. |
Click to show internal directories.
Click to hide internal directories.