Documentation
¶
Overview ¶
Package templates holds the system templates of osapi, which the controller keeps in the Object Store under osapi/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SeedSystemTemplates ¶
func SeedSystemTemplates( ctx context.Context, logger *slog.Logger, objStore TemplateStore, bucket string, ) error
SeedSystemTemplates uploads embedded osapi templates to the NATS object store with the "osapi/" prefix. Templates are updated if the embedded content differs from what's in the store (SHA comparison). These templates are protected from user deletion.
Types ¶
type TemplateStore ¶
type TemplateStore interface {
ObjectGetBytes(ctx context.Context, bucket string, name string) ([]byte, error)
ObjectPutBytes(
ctx context.Context,
bucket string,
name string,
data []byte,
) (*jetstream.ObjectInfo, error)
}
TemplateStore reads and writes the system templates in the Object Store bucket. A *natsclient.Client is one.