MCPcopy
hub / github.com/caddyserver/caddy / Provision

Method Provision

modules/caddytls/storageloader.go:53–73  ·  view source on GitHub ↗

Provision loads the storage module for sl.

(ctx caddy.Context)

Source from the content-addressed store, hash-verified

51
52// Provision loads the storage module for sl.
53func (sl *StorageLoader) Provision(ctx caddy.Context) error {
54 sl.storage = ctx.Storage()
55 sl.ctx = ctx
56
57 repl, ok := ctx.Value(caddy.ReplacerCtxKey).(*caddy.Replacer)
58 if !ok {
59 repl = caddy.NewReplacer()
60 }
61 for k, pair := range sl.Pairs {
62 for i, tag := range pair.Tags {
63 pair.Tags[i] = repl.ReplaceKnown(tag, "")
64 }
65 sl.Pairs[k] = CertKeyFilePair{
66 Certificate: repl.ReplaceKnown(pair.Certificate, ""),
67 Key: repl.ReplaceKnown(pair.Key, ""),
68 Format: repl.ReplaceKnown(pair.Format, ""),
69 Tags: pair.Tags,
70 }
71 }
72 return nil
73}
74
75// LoadCertificates returns the certificates to be loaded by sl.
76func (sl StorageLoader) LoadCertificates() ([]Certificate, error) {

Callers

nothing calls this directly

Calls 3

StorageMethod · 0.80
ReplaceKnownMethod · 0.80
ValueMethod · 0.45

Tested by

no test coverage detected