Documentation ¶
Index ¶
- Constants
- Variables
- func AddToDbIfNew(db *gorm.DB, entry data.HistoryEntry)
- func ApiGet(ctx context.Context, path string) ([]byte, error)
- func ApiPost(ctx context.Context, path, contentType string, reqBody []byte) ([]byte, error)
- func BuildTableRow(ctx context.Context, columnNames []string, entry data.HistoryEntry, ...) ([]string, error)
- func CanReachHishtoryServer(ctx context.Context) bool
- func CheckFatalError(err error)
- func CountStoredEntries(db *gorm.DB) (int64, error)
- func EncryptAndMarshal(config *hctx.ClientConfig, entries []*data.HistoryEntry) ([]byte, error)
- func GetBanner(ctx context.Context) ([]byte, error)
- func GetHttpClient() *http.Client
- func GetServerHostname() string
- func HandleDeletionRequests(ctx context.Context, deletionRequests []*shared.DeletionRequest) error
- func HandleSlsaFailure(srcErr error) error
- func ImportHistory(ctx context.Context, shouldReadStdin, force bool) (int, error)
- func IsOfflineBinary() bool
- func IsOfflineError(ctx context.Context, err error) bool
- func MakeRegexFromQuery(query string) string
- func MakeWhereQueryFromSearch(ctx context.Context, db *gorm.DB, query string) (*gorm.DB, error)
- func ProcessDeletionRequests(ctx context.Context) error
- func ReadStdin() ([]string, error)
- func ReliableDbCreate(db *gorm.DB, entry data.HistoryEntry) error
- func RetrieveAdditionalEntriesFromRemote(ctx context.Context, queryReason string) error
- func RetryingDbFunction(dbFunc func() error) error
- func RetryingDbFunctionWithResult[T any](dbFunc func() (T, error)) (T, error)
- func Reupload(ctx context.Context) error
- func Search(ctx context.Context, db *gorm.DB, query string, limit int) ([]*data.HistoryEntry, error)
- func SearchWithOffset(ctx context.Context, db *gorm.DB, query string, limit, offset int) ([]*data.HistoryEntry, error)
- func SendDeletionRequest(ctx context.Context, deletionRequest shared.DeletionRequest) error
- func Values[Slice ~[]Elem, Elem any](s Slice) iter.Seq2[Elem, error]
- func VerifyBinary(ctx context.Context, binaryPath, attestationPath, versionTag string) error
Constants ¶
View Source
const DefaultServerHostname = "https://api.hishtory.dev"
View Source
const NUM_IMPORTED_ENTRIES_SLOW int = 20_000
The number of entries where if we're importing more than this many entries, the import is likely to be slow, and it is then worth displaying a progress bar.
View Source
const SEARCH_RETRY_COUNT = 3
View Source
const SQLITE_LOCKED_ERR_MSG = "database is locked ("
Variables ¶
View Source
var ( Version string = "Unknown" GitCommit string = "Unknown" )
View Source
var BASH_FIRST_COMMAND_BUG_REGEX = regexp.MustCompile(`^#\d+\s+$`)
View Source
var ConfigFishContents string
View Source
var ConfigShContents string
View Source
var ConfigZshContents string
View Source
var ImportBatchSize = 100
The batch size for the DB operations for importing history. Used by all types of imports.
View Source
var ZSH_FIRST_COMMAND_BUG_REGEX = regexp.MustCompile(`: \d+:\d;(.*)`)
Functions ¶
func AddToDbIfNew ¶
func AddToDbIfNew(db *gorm.DB, entry data.HistoryEntry)
func BuildTableRow ¶
func CanReachHishtoryServer ¶
func CheckFatalError ¶
func CheckFatalError(err error)
func EncryptAndMarshal ¶
func EncryptAndMarshal(config *hctx.ClientConfig, entries []*data.HistoryEntry) ([]byte, error)
func GetHttpClient ¶
func GetServerHostname ¶
func GetServerHostname() string
func HandleDeletionRequests ¶
func HandleDeletionRequests(ctx context.Context, deletionRequests []*shared.DeletionRequest) error
func HandleSlsaFailure ¶
func ImportHistory ¶
func IsOfflineBinary ¶
func IsOfflineBinary() bool
func MakeRegexFromQuery ¶
Make a regex that matches the non-tokenized bits of the given query
func ProcessDeletionRequests ¶
func ReliableDbCreate ¶
func ReliableDbCreate(db *gorm.DB, entry data.HistoryEntry) error
func RetryingDbFunction ¶
func SearchWithOffset ¶
func SendDeletionRequest ¶
func SendDeletionRequest(ctx context.Context, deletionRequest shared.DeletionRequest) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.