iprepd: go.mozilla.org/iprepd Index | Files

package iprepd

import "go.mozilla.org/iprepd"

Index

Package Files

auth.go exception.go http.go iprepd.go redis.go score.go

func StartDaemon Uses

func StartDaemon(confpath string)

StartDaemon starts a new instance of iprepd using configuration file confpath.

type Reputation Uses

type Reputation struct {
    // IP is the IP address associated with the entry
    IP  string `json:"ip"`

    // Reputation is the reputation score for the IP address, ranging from 0 to
    // 100 where 100 indicates no violations have been applied to it.
    Reputation int `json:"reputation"`

    // Reviewed is true if the entry has been manually reviewed, this flag indicates
    // a firm confidence in the entry.
    Reviewed bool `json:"reviewed"`

    // LastUpdated indicates when a reputation was last either set manually or via
    // a violation on this entry
    LastUpdated time.Time `json:"lastupdated"`
}

Reputation stores information related to the reputation of a given IP address

func (*Reputation) Validate Uses

func (r *Reputation) Validate() error

Validate performs validation and normalization of a Reputation type.

type Violation Uses

type Violation struct {
    // Name of violation as specified in iprepd cfg
    Name string `json:"name"`

    // Penalty is how many points a reputation will be decreased by if this
    // violation is submitted for an IP
    Penalty int `json:"penalty"`

    // DecreaseLimit is the lowest possible value this violation will decrease a
    // reputation to. Since the same violation can be applied multiple times to
    // the same IP, this can be used to place a lower bound on the total decrease.
    DecreaseLimit int `json:"decreaselimit"`
}

Violation describes a violation penalty that can be applied to IP addresses.

type ViolationRequest Uses

type ViolationRequest struct {
    IP        string
    Violation string
}

ViolationRequest represents the structure used to apply a violation to a given IP address. This structure is used as the basis for unmarshaling requests to violation handlers in the API.

Package iprepd imports 23 packages (graph). Updated 2018-10-16. Refresh now. Tools for package owners.