filesystem

package module
v0.0.0-...-f1246e0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TempDir

func TempDir(t testing.TB, name string) string

TempDir creates a temporary directory within tmpdir with the name 'testname-name'. If the directory cannot be created t.Fatal is called. The directory will be removed when the test ends. Set TEST_NOCLEANUP env var to prevent the directory from being removed.

func TempFile

func TempFile(t testing.TB, name string) *os.File

TempFile creates a temporary file within tmpdir with the name 'testname-name'. If the file cannot be created t.Fatal is called. If a temporary directory has been created before consider storing the file inside this directory to avoid double cleanup. The file will be removed when the test ends. Set TEST_NOCLEANUP env var to prevent the file from being removed.

Types

type CertificateWatcher

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

func NewCertificateWatcher

func NewCertificateWatcher(certPath, keyPath string, logger zerolog.Logger, coalesceInterval time.Duration) (*CertificateWatcher, error)

func (*CertificateWatcher) GetCertificateFunc

func (w *CertificateWatcher) GetCertificateFunc() func(*tls.ClientHelloInfo) (*tls.Certificate, error)

func (*CertificateWatcher) Start

func (w *CertificateWatcher) Start(ctx context.Context) (func(), error)

func (*CertificateWatcher) Stop

func (w *CertificateWatcher) Stop() error

type FileWatcherEvent

type FileWatcherEvent struct {
	Filenames []string
}

type Watcher

type Watcher interface {
	Start(ctx context.Context)
	Stop() error
	Add(filename string) error
	Remove(filename string)
	Replace(oldFile, newFile string) error
	EventsCh() chan *FileWatcherEvent
}

func NewFileWatcher

func NewFileWatcher(configFiles []string, logger zerolog.Logger) (Watcher, error)

NewFileWatcher create a file watcher that will watch all the files/folders from configFiles if success a fileWatcher will be returned and a nil error otherwise an error and a nil fileWatcher are returned

func NewRateLimitedFileWatcher

func NewRateLimitedFileWatcher(configFiles []string, logger zerolog.Logger, coalesceInterval time.Duration) (Watcher, error)

Jump to

Keyboard shortcuts

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