composite

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: 6 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 chains multiple TemplateProviders. Get checks the writable provider first, then each reader in order. Register and RegisterFS delegate to the writable provider.

func NewStore

func NewStore(writable gas.TemplateProvider, readers ...gas.TemplateProvider) *Store

NewStore creates a composite store. The writable provider receives Register/RegisterFS calls and is checked first during Get. Readers are checked in order as fallbacks.

func (*Store) Get

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

Get tries the writable provider first, then each reader in order. Returns template.ErrTemplateNotFound if no provider has the template.

func (*Store) List

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

List merges template names from all providers, deduplicated and sorted.

func (*Store) Register

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

Register delegates to the writable provider.

func (*Store) RegisterFS

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

RegisterFS delegates to the writable provider.

Jump to

Keyboard shortcuts

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