Documentation ¶
Index ¶
- Variables
- type NutBreaker
- func (n *NutBreaker) Close() error
- func (n *NutBreaker) DataDir() string
- func (n *NutBreaker) Find(ip string) (value []byte, err error)
- func (n *NutBreaker) Flush() error
- func (n *NutBreaker) Insert(ipRange string, value []byte) (err error)
- func (n *NutBreaker) Remove(ipRange string) error
- func (n *NutBreaker) Reset() error
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIPv6NotSupported is returned if an IPv6 range or IP input is detected. ErrIPv6NotSupported = errors.New("IPv6 ranges are not supported") // ErrInvalidRange is returned when a passed string is not a valid range ErrInvalidRange = errors.New("invalid range passed, use either of these: <IP>, <IP>/<1-32>, <IP> - <IP>") // ErrIPNotFound is returned if the passed IP is not contained in any ranges ErrIPNotFound = errors.New("the given IP was not found in any database ranges") )
Functions ¶
This section is empty.
Types ¶
type NutBreaker ¶
type NutBreaker struct {
// contains filtered or unexported fields
}
func NewNutBreaker ¶
func NewNutBreaker(opts ...Option) (nb *NutBreaker, err error)
func (*NutBreaker) Close ¶
func (n *NutBreaker) Close() error
func (*NutBreaker) DataDir ¶
func (n *NutBreaker) DataDir() string
func (*NutBreaker) Flush ¶
func (n *NutBreaker) Flush() error
func (*NutBreaker) Remove ¶
func (n *NutBreaker) Remove(ipRange string) error
func (*NutBreaker) Reset ¶
func (n *NutBreaker) Reset() error
Click to show internal directories.
Click to hide internal directories.