Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: MIT Imports: 12 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

	PusherTomb tomb.Tomb
	// contains filtered or unexported fields
}

func NewSQLite

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

func (*Context) CleanUpRecordsByAge added in v0.2.3

func (c *Context) CleanUpRecordsByAge() error

func (*Context) CleanUpRecordsByCount added in v0.2.3

func (c *Context) CleanUpRecordsByCount() error

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) DeleteExpired added in v0.2.3

func (c *Context) DeleteExpired() error

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) StartAutoCommit added in v0.2.3

func (c *Context) StartAutoCommit() 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