reloader

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

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

type ReloadConfig struct {
	CertFile string // the cert file
	KeyFile  string // the key file
}

ReloadConfig contains the config for cert reload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL