debounce

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

type ConfigOption

type ConfigOption func(cfg *Config)

func WithAction

func WithAction(action func([][]byte)) ConfigOption

func WithBufferLimit

func WithBufferLimit(limit int) ConfigOption

func WithKeys

func WithKeys(keys ...string) ConfigOption

func WithPeriod

func WithPeriod(period time.Duration) ConfigOption

type Debouncer

type Debouncer interface {
	Add(...PayloadOption)
}

type Deduper

type Deduper struct {
	Config
	// contains filtered or unexported fields
}

func NewDeduper

func NewDeduper(ctx context.Context, opts ...ConfigOption) *Deduper

func (*Deduper) Add

func (d *Deduper) Add(oss ...PayloadOption)

type Factory

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

func NewFactory

func NewFactory(t Type, opts ...ConfigOption) *Factory

func (Factory) Init

func (f Factory) Init(ctx context.Context, opts ...ConfigOption) Debouncer

type Limiter

type Limiter struct {
	Config
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter(ctx context.Context, opts ...ConfigOption) *Limiter

func (*Limiter) Add

func (d *Limiter) Add(oss ...PayloadOption)

type Payload

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

type PayloadOption

type PayloadOption func(o *Payload)

func Bytes

func Bytes(buf []byte) PayloadOption

type Type

type Type int
const (
	TypeDeduper Type = iota
	TypeLimiter
)

Jump to

Keyboard shortcuts

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