results

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterCloseFunc

type AfterCloseFunc func(error) error

AfterCloseFunc is a handler for the after Close hook

type AfterNextFunc

type AfterNextFunc func(<-chan query.Result) <-chan query.Result

AfterNextFunc is a handler for the after Next hook

type AfterNextSyncFunc

type AfterNextSyncFunc func(query.Result, bool) (query.Result, bool)

AfterNextSyncFunc is a handler for the after NextSync hook

type AfterRestFunc

type AfterRestFunc func([]query.Entry, error) ([]query.Entry, error)

AfterRestFunc is a handler for the after Rest hook

type BeforeCloseFunc

type BeforeCloseFunc func()

BeforeCloseFunc is a handler for the before Close hook

type BeforeNextFunc

type BeforeNextFunc func()

BeforeNextFunc is a handler for the before Next hook

type BeforeNextSyncFunc

type BeforeNextSyncFunc func()

BeforeNextSyncFunc is a handler for the before NextSync hook

type BeforeRestFunc

type BeforeRestFunc func() ([]query.Entry, error)

BeforeRestFunc is a handler for the before Rest hook

type Option

type Option func(*Options) error

Option is the results option type.

func WithAfterClose

func WithAfterClose(f AfterCloseFunc) Option

WithAfterClose configures a hook that is called _after_ Rest. Defaults to noop.

func WithAfterNext

func WithAfterNext(f AfterNextFunc) Option

WithAfterNext configures a hook that is called _after_ Next. Defaults to noop.

func WithAfterNextSync

func WithAfterNextSync(f AfterNextSyncFunc) Option

WithAfterNextSync configures a hook that is called _after_ NextSync. Defaults to noop.

func WithAfterRest

func WithAfterRest(f AfterRestFunc) Option

WithAfterRest configures a hook that is called _after_ Rest. Defaults to noop.

func WithBeforeClose

func WithBeforeClose(f BeforeCloseFunc) Option

WithBeforeClose configures a hook that is called _before_ Close. Defaults to noop.

func WithBeforeNext

func WithBeforeNext(f BeforeNextFunc) Option

WithBeforeNext configures a hook that is called _before_ Next. Defaults to noop.

func WithBeforeNextSync

func WithBeforeNextSync(f BeforeNextSyncFunc) Option

WithBeforeNextSync configures a hook that is called _before_ NextSync. Defaults to noop.

func WithBeforeRest

func WithBeforeRest(f BeforeRestFunc) Option

WithBeforeRest configures a hook that is called _before_ Rest. Defaults to noop.

type Options

type Options struct {
	BeforeNext     BeforeNextFunc
	AfterNext      AfterNextFunc
	BeforeNextSync BeforeNextSyncFunc
	AfterNextSync  AfterNextSyncFunc
	BeforeRest     BeforeRestFunc
	AfterRest      AfterRestFunc
	BeforeClose    BeforeCloseFunc
	AfterClose     AfterCloseFunc
}

Options are results options.

func (*Options) Apply

func (o *Options) Apply(opts ...Option) error

Apply applies the given options to this Option.

type Results

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

func NewResults

func NewResults(res query.Results, options ...Option) *Results

func (*Results) Close

func (hres *Results) Close() error

func (*Results) Next

func (hres *Results) Next() <-chan query.Result

func (*Results) NextSync

func (hres *Results) NextSync() (query.Result, bool)

func (*Results) Process

func (hres *Results) Process() goprocess.Process

func (*Results) Query

func (hres *Results) Query() query.Query

func (*Results) Rest

func (hres *Results) Rest() ([]query.Entry, error)

Jump to

Keyboard shortcuts

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