observer

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package observer provides storage observer

Package observer provides storage observer

Package observer provides storage observer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupInfo added in v0.0.51

type BackupInfo struct {
	StartTime time.Time
	EndTime   time.Time
	Bytes     int64

	*storage.StorageInfo
}

type Hook added in v0.0.51

type Hook interface {
	BeforeProcess(ctx context.Context, info *BackupInfo) (context.Context, error)
	AfterProcess(ctx context.Context, info *BackupInfo) error
}

type Option

type Option func(o *observer) error

func WithBackupDuration

func WithBackupDuration(dur string) Option

func WithBlobStorage

func WithBlobStorage(storage storage.Storage) Option

func WithDir

func WithDir(dir string) Option

func WithErrGroup

func WithErrGroup(eg errgroup.Group) Option

func WithHooks added in v0.0.51

func WithHooks(hooks ...Hook) Option

func WithPostStopTimeout

func WithPostStopTimeout(dur string) Option

func WithTicker added in v0.0.47

func WithTicker(enabled bool) Option

func WithWatch added in v0.0.47

func WithWatch(enabled bool) Option

type StorageObserver

type StorageObserver interface {
	Start(ctx context.Context) (<-chan error, error)
	PostStop(ctx context.Context) error
}

func New

func New(opts ...Option) (so StorageObserver, err error)

Jump to

Keyboard shortcuts

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