dao

package
v0.0.0-...-cda5842 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDatabaseFlags

func AddDatabaseFlags(flags *pflag.FlagSet)

func GetConnection

func GetConnection() (*gorm.DB, error)

func GetConnectionOrDie

func GetConnectionOrDie() *gorm.DB

func IsInvalidHashError

func IsInvalidHashError(err error) bool

func IsRainbowTableExistsError

func IsRainbowTableExistsError(err error) bool

func IsRainbowTableNotExistsError

func IsRainbowTableNotExistsError(err error) bool

Types

type DbRainbowChainService

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

func (*DbRainbowChainService) CountChainsForRainbowTable

func (service *DbRainbowChainService) CountChainsForRainbowTable(rainbowTableId int16) (int64, error)

func (*DbRainbowChainService) CreateRainbowChains

func (service *DbRainbowChainService) CreateRainbowChains(rainbowTableId int16, rainbowChains []model.RainbowChain) error

func (*DbRainbowChainService) FindChainByTableIdAndEndHashIn

func (service *DbRainbowChainService) FindChainByTableIdAndEndHashIn(rainbowTableId int16, endHashes [][]byte) ([]model.RainbowChain, error)

type DbRainbowTableSearchService

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

func (*DbRainbowTableSearchService) CountRainbowTableSearches

func (service *DbRainbowTableSearchService) CountRainbowTableSearches(rainbowTableId int16, includeNotFound bool) (int64, error)

func (*DbRainbowTableSearchService) CreateRainbowTableSearch

func (service *DbRainbowTableSearchService) CreateRainbowTableSearch(rainbowTableId int16, hash string) (model.RainbowTableSearch, error)

func (*DbRainbowTableSearchService) FindRainbowTableSearchById

func (service *DbRainbowTableSearchService) FindRainbowTableSearchById(searchId int64) (model.RainbowTableSearch, error)

func (*DbRainbowTableSearchService) GetRainbowTableSearchResults

func (service *DbRainbowTableSearchService) GetRainbowTableSearchResults(rainbowTableId int16) (RainbowTableSearchResultSummary, error)

func (*DbRainbowTableSearchService) ListSearchesByRainbowTableId

func (service *DbRainbowTableSearchService) ListSearchesByRainbowTableId(
	rainbowTableId int16,
	includeNotFound bool,
	pageConfig PageConfig,
) ([]model.RainbowTableSearch, error)

func (*DbRainbowTableSearchService) UpdateRainbowTableSearchStatus

func (service *DbRainbowTableSearchService) UpdateRainbowTableSearchStatus(searchId int64, status string) error

func (*DbRainbowTableSearchService) UpdateRainbowTableSearchStatusAndSearchStarted

func (service *DbRainbowTableSearchService) UpdateRainbowTableSearchStatusAndSearchStarted(searchId int64, status string) error

func (*DbRainbowTableSearchService) UpdateRainbowTableSearchStatusPasswordAndSearchCompleted

func (service *DbRainbowTableSearchService) UpdateRainbowTableSearchStatusPasswordAndSearchCompleted(
	searchId int64,
	status string,
	password string,
) error

type DbRainbowTableService

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

func (*DbRainbowTableService) CountRainbowTables

func (service *DbRainbowTableService) CountRainbowTables() (int64, error)

func (*DbRainbowTableService) CreateRainbowTable

func (service *DbRainbowTableService) CreateRainbowTable(rainbowTable *model.RainbowTable) (*model.RainbowTable, error)

func (*DbRainbowTableService) DeleteRainbowTableById

func (service *DbRainbowTableService) DeleteRainbowTableById(id int16) error

func (*DbRainbowTableService) FindRainbowTableById

func (service *DbRainbowTableService) FindRainbowTableById(rainbowTableId int16) (model.RainbowTable, error)

func (*DbRainbowTableService) FindRainbowTableByName

func (service *DbRainbowTableService) FindRainbowTableByName(name string) (model.RainbowTable, error)

func (*DbRainbowTableService) IncrementRainbowTableChainsGenerated

func (service *DbRainbowTableService) IncrementRainbowTableChainsGenerated(id int16, chainsGenerated int64) error

func (*DbRainbowTableService) ListRainbowTables

func (service *DbRainbowTableService) ListRainbowTables(pageConfig PageConfig) ([]model.RainbowTable, error)

func (*DbRainbowTableService) UpdateRainbowTableStatus

func (service *DbRainbowTableService) UpdateRainbowTableStatus(id int16, status string) error

func (*DbRainbowTableService) UpdateRainbowTableStatusAndFinalChainCount

func (service *DbRainbowTableService) UpdateRainbowTableStatusAndFinalChainCount(id int16, status string, finalChainCount int64) error

func (*DbRainbowTableService) UpdateRainbowTableStatusAndGenerateStarted

func (service *DbRainbowTableService) UpdateRainbowTableStatusAndGenerateStarted(id int16, status string) error

type InvalidHashError

type InvalidHashError struct {
	Hash             string
	HashFunctionName string
}

func (InvalidHashError) Error

func (err InvalidHashError) Error() string

type PageConfig

type PageConfig struct {
	Descending bool
	PageNumber int
	PageSize   int
	SortKey    string
}

type RainbowChainService

type RainbowChainService interface {
	CreateRainbowChains(int16, []model.RainbowChain) error
	CountChainsForRainbowTable(int16) (int64, error)
	FindChainByTableIdAndEndHashIn(int16, [][]byte) ([]model.RainbowChain, error)
}

func NewRainbowChainService

func NewRainbowChainService(db *gorm.DB) RainbowChainService

type RainbowTableExistsError

type RainbowTableExistsError struct {
	Name string
}

func (RainbowTableExistsError) Error

func (err RainbowTableExistsError) Error() string

type RainbowTableNotExistsError

type RainbowTableNotExistsError struct {
	ID int16
}

func (RainbowTableNotExistsError) Error

func (err RainbowTableNotExistsError) Error() string

type RainbowTableSearchResultSummary

type RainbowTableSearchResultSummary struct {
	FoundSearches int64 `json:"foundSearches"`
	TotalSearches int64 `json:"totalSearches"`
}

type RainbowTableSearchResults

type RainbowTableSearchResults struct {
	Count        int64  `gorm:"column:count"json:"count"`
	SearchStatus string `gorm:"column:status"json:"searchStatus"`
}

type RainbowTableSearchService

type RainbowTableSearchService interface {
	CountRainbowTableSearches(rainbowTableId int16, includeNotFound bool) (int64, error)
	CreateRainbowTableSearch(rainbowTableId int16, hash string) (model.RainbowTableSearch, error)
	ListSearchesByRainbowTableId(rainbowTableId int16, includeNotFound bool, pageConfig PageConfig) ([]model.RainbowTableSearch, error)
	GetRainbowTableSearchResults(rainbowTableId int16) (RainbowTableSearchResultSummary, error)
	FindRainbowTableSearchById(int64) (model.RainbowTableSearch, error)
	UpdateRainbowTableSearchStatus(int64, string) error
	UpdateRainbowTableSearchStatusAndSearchStarted(int64, string) error
	UpdateRainbowTableSearchStatusPasswordAndSearchCompleted(int64, string, string) error
}

func NewRainbowTableSearchService

func NewRainbowTableSearchService(db *gorm.DB) RainbowTableSearchService

type RainbowTableService

type RainbowTableService interface {
	CountRainbowTables() (int64, error)
	CreateRainbowTable(*model.RainbowTable) (*model.RainbowTable, error)
	DeleteRainbowTableById(int16) error
	FindRainbowTableById(int16) (model.RainbowTable, error)
	FindRainbowTableByName(string) (model.RainbowTable, error)
	IncrementRainbowTableChainsGenerated(int16, int64) error
	ListRainbowTables(PageConfig) ([]model.RainbowTable, error)
	UpdateRainbowTableStatus(int16, string) error
	UpdateRainbowTableStatusAndFinalChainCount(int16, string, int64) error
	UpdateRainbowTableStatusAndGenerateStarted(int16, string) error
}

func NewRainbowTableService

func NewRainbowTableService(db *gorm.DB) RainbowTableService

Jump to

Keyboard shortcuts

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