watcher

package
v2.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package watcher implements a file watcher to update an object on file changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWatcher

type FileWatcher struct {
	// contains filtered or unexported fields
}

FileWatcher watches for changes to the file and calls the waiter's Update method.

func New

func New(log *slog.Logger, updater updater) (*FileWatcher, error)

New creates a new FileWatcher for the given validator.

func (*FileWatcher) Close

func (f *FileWatcher) Close() error

Close closes the watcher. It should only be called once.

func (*FileWatcher) Watch

func (f *FileWatcher) Watch(file string) error

Watch starts watching the file at the given path. It will call the watcher's Update method when the file is modified.

type Updatable

type Updatable struct {
	atls.Validator
	// contains filtered or unexported fields
}

Updatable implements an updatable atls.Validator.

func NewValidator

func NewValidator(log *slog.Logger, variant variant.Variant, fileHandler file.Handler, cachedCerts cachedCerts) (*Updatable, error)

NewValidator initializes a new updatable validator and performs an initial update (aka. initialization).

func (*Updatable) OID

func (u *Updatable) OID() asn1.ObjectIdentifier

OID returns the validators Object Identifier.

func (*Updatable) Update

func (u *Updatable) Update() error

Update switches out the underlying validator.

func (*Updatable) Validate

func (u *Updatable) Validate(ctx context.Context, attDoc []byte, nonce []byte) ([]byte, error)

Validate calls the validators Validate method, and prevents any updates during the call.

Jump to

Keyboard shortcuts

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