MCPcopy
hub / github.com/grpc/grpc-go / validate

Method validate

security/advancedtls/crl_provider.go:130–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130func (o *FileWatcherOptions) validate() error {
131 // Checks relates to CRLDirectory.
132 if o.CRLDirectory == "" {
133 return fmt.Errorf("advancedtls: CRLDirectory needs to be specified")
134 }
135 if _, err := os.ReadDir(o.CRLDirectory); err != nil {
136 return fmt.Errorf("advancedtls: CRLDirectory %v is not readable: %v", o.CRLDirectory, err)
137 }
138 // Checks related to RefreshDuration.
139 if o.RefreshDuration == 0 {
140 o.RefreshDuration = defaultCRLRefreshDuration
141 }
142 if o.RefreshDuration < minCRLRefreshDuration {
143 grpclogLogger.Warningf("RefreshDuration must be at least 1 minute: provided value %v, minimum value %v will be used.", o.RefreshDuration, minCRLRefreshDuration)
144 o.RefreshDuration = minCRLRefreshDuration
145 }
146 return nil
147}
148
149// Start starts watching the directory for CRL files and updates the provider accordingly.
150func (p *FileWatcherCRLProvider) run() {

Callers 1

Calls 2

ErrorfMethod · 0.65
WarningfMethod · 0.65

Tested by

no test coverage detected