Documentation ¶
Overview ¶
Copyright 2019, Oath Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertReloader ¶
type CertReloader struct {
// contains filtered or unexported fields
}
CertReloader reloads the (key, cert) pair from the filesystem when the cert file is updated.
func NewCertReloader ¶
func NewCertReloader(config ReloadConfig, stopCh <-chan struct{}) (*CertReloader, error)
NewCertReloader returns a CertReloader that starts a file watcher which reloads the (key, cert) pair whenever the cert file changes on the filesystem.
func (*CertReloader) FileUpdate ¶
func (w *CertReloader) FileUpdate()
FileUpdate spawns a internal fileUpdate go routine.
func (*CertReloader) GetLatestCertificate ¶
func (w *CertReloader) GetLatestCertificate() *tls.Certificate
GetLatestCertificate returns the latest known certificate.
func (*CertReloader) GetLatestKeyAndCert ¶
func (w *CertReloader) GetLatestKeyAndCert() ([]byte, []byte)
GetLatestKeyAndCert returns the latest known key and certificate in raw bytes.
func (*CertReloader) WatchError ¶
func (w *CertReloader) WatchError(err error)
WatchError will process any errors received from the file watch.
type ReloadConfig ¶
ReloadConfig contains the config for cert reload.