processor

package
Version: v0.0.0-...-1730ba2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package processor specifies the common pieces for other processors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Outcome

type Outcome int

Outcome represents the possible outcomes for a request processor

const (
	// ALLOW means that the request is known to be OK
	ALLOW Outcome = iota

	// BLOCK means that the request is known to be NOK
	BLOCK

	// NEUTRAL means that the processor can't know for sure whether the request is good
	NEUTRAL
)

func (Outcome) String

func (o Outcome) String() string

type Processor

type Processor interface {
	Process(req *http.Request) (Outcome, error)
}

Processor defines a common interface for all processors

type Registry

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

Registry stores all the processors known to this application

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new registry instance with the default processors

func (*Registry) GetOutcome

func (r *Registry) GetOutcome(req *http.Request) Outcome

GetOutcome for the given request, stopping after the first non-neutral outcome

func (*Registry) List

func (r *Registry) List() []Processor

List the registered processors

func (*Registry) Register

func (r *Registry) Register(p Processor)

Register a new processor

Directories

Path Synopsis
Package thehoneypotproject specifies a processor that matches the client IP with thehoneypotproject
Package thehoneypotproject specifies a processor that matches the client IP with thehoneypotproject
Package whitelist specifies a processor that matches the request with a whitelist
Package whitelist specifies a processor that matches the request with a whitelist

Jump to

Keyboard shortcuts

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