timeoutwr

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package timeoutwr provides a wrapper for RBLs that sets a timeout in the check resquests.

This package is a work in progress and makes no API stability promises.

Index

Constants

View Source
const DefaultTimeout = 1 * time.Second

DefaultTimeout sets default timeout in construction.

View Source
const WrapperClass = "timeout"

WrapperClass registered.

Variables

This section is empty.

Functions

func Builder

func Builder(timeout time.Duration) xlistd.BuildWrapperFn

Builder returns a builder function.

Types

type Wrapper

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

Wrapper implements an xlistd.List wrapper for include a timeout in check requests.

func New

func New(list xlistd.List, timeout time.Duration) *Wrapper

New creates a Wrapper with timeout.

func (*Wrapper) Check

func (w *Wrapper) Check(ctx context.Context, name string, resource xlist.Resource) (xlist.Response, error)

Check implements xlist.Checker interface.

func (*Wrapper) Class

func (w *Wrapper) Class() string

Class implements xlistd.List interface.

func (*Wrapper) ID

func (w *Wrapper) ID() string

ID implements xlistd.List interface.

func (*Wrapper) Ping

func (w *Wrapper) Ping() error

Ping implements xlistd.List interface.

func (*Wrapper) Resources

func (w *Wrapper) Resources(ctx context.Context) ([]xlist.Resource, error)

Resources implements xlist.Checker interface.

Jump to

Keyboard shortcuts

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