Documentation ¶
Index ¶
- Variables
- type Item
- type Repository
- func (s *Repository) Add(ip net.IP, duration time.Duration, byUserID int64, reason string) error
- func (s *Repository) Clear() error
- func (s *Repository) Exists(ip net.IP) (bool, error)
- func (s *Repository) GC() (int64, error)
- func (s *Repository) Get(ip net.IP) (*Item, error)
- func (s *Repository) Remove(ip net.IP) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBanItemNotFound = errors.New("ban item not found")
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { IP net.IP `json:"ip"` Until time.Time `json:"up_to"` ByUserID int64 `json:"by_user_id"` Reason string `json:"reason"` }
Item Item.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository Main Object.
func NewRepository ¶
func NewRepository(db *goqu.Database) (*Repository, error)
NewRepository constructor.
Click to show internal directories.
Click to hide internal directories.