Documentation ¶
Index ¶
- Constants
- func ParseConfigWithDefaults[T any](defaults T, rawConfig json.RawMessage) (T, error)
- func ParseTLSVersion(verStr string) (uint16, error)
- func RenewRepeatIntervalFunc(fallbackInterval time.Duration) loop.RepeatIntervalFunc
- type FileCache
- type FileCacheOption
- type FileCacheOptions
- type GenericFactory
Constants ¶
View Source
const ( DefaultCacheRoot = `.tmp/certs` CachedFileKeyCertificate = `cert` CachedFileKeyPrivateKey = `key` CachedFileKeyCA = `ca` )
Variables ¶
This section is empty.
Functions ¶
func ParseConfigWithDefaults ¶
func ParseConfigWithDefaults[T any](defaults T, rawConfig json.RawMessage) (T, error)
func ParseTLSVersion ¶
func RenewRepeatIntervalFunc ¶
func RenewRepeatIntervalFunc(fallbackInterval time.Duration) loop.RepeatIntervalFunc
RenewRepeatIntervalFunc create a loop.RepeatIntervalFunc for renewing certificate. The interval is set to the half way between now and cached certificate expiration. If "fallbackInterval" is provided, it is used for any error cases
Types ¶
type FileCache ¶
func NewFileCache ¶
func NewFileCache(opts ...FileCacheOptions) (*FileCache, error)
func (*FileCache) CacheCertificate ¶
func (c *FileCache) CacheCertificate(cert *tls.Certificate) error
CacheCertificate will write out a cert and key to files based on configured path and prefix
func (*FileCache) CachePEM ¶
CachePEM write given data into file. The file name is determined by "key" and "suffix"
func (*FileCache) ResolvePath ¶
type FileCacheOption ¶
type FileCacheOption struct { Root string Type certs.SourceType Prefix string }
type FileCacheOptions ¶
type FileCacheOptions func(opt *FileCacheOption)
type GenericFactory ¶
type GenericFactory[PropertiesType any] struct { SourceType certs.SourceType Defaults PropertiesType Constructor func(props PropertiesType) certs.Source }
func NewFactory ¶
func NewFactory[PropertiesType any](typ certs.SourceType, rawDefaultConfig json.RawMessage, constructor func(props PropertiesType) certs.Source) (*GenericFactory[PropertiesType], error)
func (*GenericFactory[T]) LoadAndInit ¶
func (f *GenericFactory[T]) LoadAndInit(_ context.Context, opts ...certs.SourceOptions) (certs.Source, error)
func (*GenericFactory[T]) Type ¶
func (f *GenericFactory[T]) Type() certs.SourceType
Click to show internal directories.
Click to hide internal directories.