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

Method Provision

modules/caddytls/distributedstek/distributedstek.go:71–93  ·  view source on GitHub ↗

Provision provisions s.

(ctx caddy.Context)

Source from the content-addressed store, hash-verified

69
70// Provision provisions s.
71func (s *Provider) Provision(ctx caddy.Context) error {
72 s.ctx = ctx
73
74 // unpack the storage module to use, if different from the default
75 if s.Storage != nil {
76 val, err := ctx.LoadModule(s, "Storage")
77 if err != nil {
78 return fmt.Errorf("loading TLS storage module: %s", err)
79 }
80 cmStorage, err := val.(caddy.StorageConverter).CertMagicStorage()
81 if err != nil {
82 return fmt.Errorf("creating TLS storage configuration: %v", err)
83 }
84 s.storage = cmStorage
85 }
86
87 // otherwise, use default storage
88 if s.storage == nil {
89 s.storage = ctx.Storage()
90 }
91
92 return nil
93}
94
95// Initialize sets the configuration for s and returns the starting keys.
96func (s *Provider) Initialize(config *caddytls.SessionTicketService) ([][32]byte, error) {

Callers

nothing calls this directly

Calls 3

LoadModuleMethod · 0.80
StorageMethod · 0.80
CertMagicStorageMethod · 0.65

Tested by

no test coverage detected