Provision loads the storage module for sl.
(ctx caddy.Context)
| 51 | |
| 52 | // Provision loads the storage module for sl. |
| 53 | func (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. |
| 76 | func (sl StorageLoader) LoadCertificates() ([]Certificate, error) { |
nothing calls this directly
no test coverage detected