sqlite

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Db *gorm.DB //Pointer to sqlite db
	// contains filtered or unexported fields
}

func NewSQLite

func NewSQLite(cfg map[string]string) (*Context, error)

func (*Context) AutoCommit

func (c *Context) AutoCommit()

func (*Context) DeleteAll

func (c *Context) DeleteAll() error

func (*Context) DeleteBan

func (c *Context) DeleteBan(target string) (int, error)

try to delete entries with matching fields

func (*Context) Flush

func (c *Context) Flush() error

func (*Context) GetBansAt

func (c *Context) GetBansAt(at time.Time) ([]map[string]string, error)

GetBansAt returns the IPs that were banned at a given time

func (*Context) GetStats

func (c *Context) GetStats(since time.Duration) ([]map[string]string, error)

func (*Context) WriteBanApplication

func (c *Context) WriteBanApplication(ban types.BanApplication) error

we simply append the event to the transaction

func (*Context) WriteSignal

func (c *Context) WriteSignal(sig types.SignalOccurence) error

Jump to

Keyboard shortcuts

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