responsewr

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: 7 Imported by: 0

Documentation

Overview

Package responsewr provides a wrapper for RBLs that changes the responses.

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

Index

Constants

View Source
const WrapperClass = "response"

WrapperClass registered.

Variables

This section is empty.

Functions

func Builder

func Builder(defaultCfg Config) xlistd.BuildWrapperFn

Builder returns a builder function.

Types

type Config

type Config struct {
	Clean        bool
	Aggregate    bool
	Negate       bool
	Reason       string
	Preffix      string
	TTL          int
	NegativeTTL  int
	UseThreshold bool
	Score        int
}

Config options.

type Wrapper

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

Wrapper implements an xlistd.List wrapper for change responses.

func New

func New(list xlistd.List, cfg Config) *Wrapper

New returns a new Wrapper.

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.Ping 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