Documentation
¶
Index ¶
- func NewStore(dir string) func() *Store
- type Store
- func (s *Store) Close() error
- func (s *Store) Get(_ context.Context, name string) ([]byte, error)
- func (s *Store) List(_ context.Context) ([]string, error)
- func (s *Store) Register(_ context.Context, name string, content []byte) error
- func (s *Store) RegisterFS(ctx context.Context, fsys fs.FS) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads templates from a directory on disk. File operations are sandboxed to the root directory via os.Root. An in-memory overlay handles programmatic registrations via Register and RegisterFS.
func (*Store) Get ¶
Get returns the raw template content by name. Checks the in-memory overlay first, then falls back to disk.
func (*Store) List ¶
List returns all available template names from both disk and the overlay, sorted and deduplicated.
Click to show internal directories.
Click to hide internal directories.