memory

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory template store implementing gas.TemplateProvider. Safe for concurrent use.

func NewStore

func NewStore() *Store

NewStore creates an empty in-memory template store.

func (*Store) Get

func (s *Store) Get(_ context.Context, name string) ([]byte, error)

Get returns the raw template content by name.

func (*Store) List

func (s *Store) List(_ context.Context) ([]string, error)

List returns all available template names in sorted order.

func (*Store) Register

func (s *Store) Register(_ context.Context, name string, content []byte) error

Register adds or replaces a template by name and raw content.

func (*Store) RegisterFS

func (s *Store) RegisterFS(ctx context.Context, fsys fs.FS) error

RegisterFS walks an fs.FS and registers every .html file found. Names are relative paths with forward slashes (e.g. "layouts/base.html").

Jump to

Keyboard shortcuts

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