watch

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileDeleted     = errors.New("watched file has been deleted")
	ErrFileOverwritten = errors.New("watched file has been overwritten")
	ErrFileRenamed     = errors.New("watched file has been renamed")
)

Functions

This section is empty.

Types

type OffsetGetter

type OffsetGetter interface {
	// GetOffset returns the current transaction head file offset.
	GetOffset() int64
}

OffsetGetter defines the interface for transaction head file offset getters.

type Option

type Option func(*reader)

Option configures watch readers.

func SeekEnd

func SeekEnd() Option

SeekEnd points the reader to the end of the contents.

func StartOffset

func StartOffset(offset int64) Option

StartOffset sets the initial offset for the reader.

type Reader

type Reader interface {
	io.ReadCloser
	Watcher
	OffsetGetter
}

Reader defines the interface for transaction head file readers.

func NewReader

func NewReader(options ...Option) Reader

NewReader creates a new transaction head file reader.

type Watcher

type Watcher interface {
	// Watch starts watching a transaction head file for changer.
	Watch(ctx context.Context, name string) error
}

Watcher defines the interface for trasaction head file watchers.

Jump to

Keyboard shortcuts

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