Versions in this module Expand all Collapse all v2 v2.0.3 Jan 31, 2024 v2.0.2 Jan 31, 2024 v2.0.1 Dec 29, 2023 v2.0.0 Sep 1, 2023 Changes in this version + const ErrConnectionFailed + const ErrDatabaseInconsistent + const ErrDatabaseInit + const ErrIPNotFound + const ErrIPv6NotSupported + const ErrInvalidIP + const ErrInvalidRange + const ErrNoResult + var DeleteReason = "_________________DELETE_________________" + var IPRangesKey = "________________IP_RANGES________________" + type Client struct + func NewClient(ctx context.Context, options Options) (*Client, error) + func (c *Client) Close() error + func (c *Client) Find(ctx context.Context, ip string) (reason string, err error) + func (c *Client) Flush(ctx context.Context) error + func (c *Client) Insert(ctx context.Context, ipRange, reason string) error + func (c *Client) Remove(ctx context.Context, ipRange string) error + func (c *Client) Reset(ctx context.Context) error + func (c *Client) UpdateReasonOf(ctx context.Context, ip string, fn UpdateFunc) (err error) + type Error string + func (e Error) Error() string + type Options struct + Addr string + ClientName string + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + ContextTimeoutEnabled bool + CredentialsProvider func() (username string, password string) + DB int + DialTimeout time.Duration + Dialer func(ctx context.Context, network, addr string) (net.Conn, error) + Limiter redis.Limiter + MaxIdleConns int + MaxRetries int + MaxRetryBackoff time.Duration + MinIdleConns int + MinRetryBackoff time.Duration + Network string + OnConnect func(ctx context.Context, cn *redis.Conn) error + Password string + PoolFIFO bool + PoolSize int + PoolTimeout time.Duration + Protocol int + ReadTimeout time.Duration + TLSConfig *tls.Config + Username string + WriteTimeout time.Duration + type UpdateFunc func(oldReason string) (newReason string) Other modules containing this package github.com/jxsl13/goripr