policywr

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 policywr provides a wrapper for RBLs that inserts policies into responses.

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

Index

Constants

View Source
const WrapperClass = "policy"

WrapperClass defines class name for component builder.

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 {
	Merge        bool
	UseThreshold bool
	Score        int
}

Config options

type Wrapper

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

Wrapper implements an xlistd.List wrapper for insert policies.

func New

func New(list xlistd.List, p reason.Policy, 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