storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlagStorage

type FlagStorage interface {
	Init() error
	GetLastFlags(limit int) ([]flag.Flag, error)
	GetByStatus(status string, limit int) ([]flag.Flag, error)
	GetStatisticsV1() (StatisticsV1, error)
	UpdateSentFlag(flag, status, checkSystemResponse string, sentTime time.Time) error
	InsertFlags(flags []flag.Flag) (int64, error)
}

type MariaDBStorage

type MariaDBStorage struct {
	// contains filtered or unexported fields
}

func NewMariaDBStorage

func NewMariaDBStorage(addr string) (*MariaDBStorage, error)

func (*MariaDBStorage) Close

func (s *MariaDBStorage) Close() error

func (*MariaDBStorage) GetByStatus

func (s *MariaDBStorage) GetByStatus(status string, limit int) ([]flag.Flag, error)

func (*MariaDBStorage) GetLastFlags

func (s *MariaDBStorage) GetLastFlags(limit int) ([]flag.Flag, error)

func (*MariaDBStorage) GetStatisticsV1

func (s *MariaDBStorage) GetStatisticsV1() (StatisticsV1, error)

func (*MariaDBStorage) Init

func (s *MariaDBStorage) Init() error

func (*MariaDBStorage) InsertFlags

func (s *MariaDBStorage) InsertFlags(flags []flag.Flag) (int64, error)

func (*MariaDBStorage) UpdateSentFlag

func (s *MariaDBStorage) UpdateSentFlag(flag, status, checkSystemResponse string, sentTime time.Time) error

type SqliteStorage

type SqliteStorage struct {
	// contains filtered or unexported fields
}

func NewSQliteStorage

func NewSQliteStorage(path string) (*SqliteStorage, error)

func (*SqliteStorage) Close

func (s *SqliteStorage) Close() error

func (*SqliteStorage) GetByStatus

func (s *SqliteStorage) GetByStatus(status string, limit int) ([]flag.Flag, error)

func (*SqliteStorage) GetLastFlags

func (s *SqliteStorage) GetLastFlags(limit int) ([]flag.Flag, error)

func (*SqliteStorage) GetStatisticsV1

func (s *SqliteStorage) GetStatisticsV1() (StatisticsV1, error)

func (*SqliteStorage) Init

func (s *SqliteStorage) Init() error

func (*SqliteStorage) InsertFlags

func (s *SqliteStorage) InsertFlags(flags []flag.Flag) (int64, error)

func (*SqliteStorage) UpdateSentFlag

func (s *SqliteStorage) UpdateSentFlag(flag, status, checkSystemResponse string, sentTime time.Time) error

type StatisticsV1

type StatisticsV1 struct {
	TotalFlags         int
	TotalFlagsByStatus map[string]int
}

type StatsByExploit

type StatsByExploit struct {
	Hour    time.Time
	Exploit string
	Status  string
	Count   int
}

Jump to

Keyboard shortcuts

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