Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultStoreDir is the default directory name for storing scan histories file DefaultStoreDir = ".secretscanner" // DefaultStoreFile is the default scan histories file name DefaultStoreFile = "scan-histories.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct { ID string `json:"id"` GitProvider string `json:"git_provider"` RepoID string `json:"repo_id"` CommitHash string `json:"commit_hash"` CreatedAt string `json:"created_at"` }
History contains scan history fields
type JSONFileStore ¶
JSONFileStore is a JSON-based storage for scan histories
func (*JSONFileStore) Get ¶
func (fs *JSONFileStore) Get(gitprovider, repoID string) *History
Get retrieves history from store
func (*JSONFileStore) GetDefaultStorePath ¶
func (fs *JSONFileStore) GetDefaultStorePath() (string, error)
GetDefaultStorePath returns default store file path, creates dir and file is not found
func (*JSONFileStore) Initialize ¶
func (fs *JSONFileStore) Initialize(filepath string) error
Initialize ...
func (*JSONFileStore) Save ¶
func (fs *JSONFileStore) Save(history *History) error
Save persists records to file
Click to show internal directories.
Click to hide internal directories.