data

package
v0.0.0-...-7ae9f15 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KdfUserID        = "user_id"
	KdfEncryptionKey = "encryption_key"
	CONFIG_PATH      = ".hishtory.config"
	DB_PATH          = ".hishtory.db"
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(userSecret string, data, additionalData, nonce []byte) ([]byte, error)

func Encrypt

func Encrypt(userSecret string, data, additionalData []byte) ([]byte, []byte, error)

func EncryptHistoryEntry

func EncryptHistoryEntry(userSecret string, entry HistoryEntry) (shared.EncHistoryEntry, error)

func EncryptionKey

func EncryptionKey(userSecret string) []byte

func GetHishtoryPath

func GetHishtoryPath() string

func UserId

func UserId(key string) string

Types

type CustomColumn

type CustomColumn struct {
	Name string `json:"name"`
	Val  string `json:"value"`
}

type CustomColumns

type CustomColumns []CustomColumn

func (*CustomColumns) Scan

func (c *CustomColumns) Scan(value any) error

func (CustomColumns) Value

func (c CustomColumns) Value() (driver.Value, error)

type HistoryEntry

type HistoryEntry struct {
	LocalUsername           string        `json:"local_username" gorm:"uniqueIndex:compositeindex"`
	Hostname                string        `json:"hostname" gorm:"uniqueIndex:compositeindex"`
	Command                 string        `json:"command" gorm:"uniqueIndex:compositeindex"`
	CurrentWorkingDirectory string        `json:"current_working_directory" gorm:"uniqueIndex:compositeindex"`
	HomeDirectory           string        `json:"home_directory" gorm:"uniqueIndex:compositeindex"`
	ExitCode                int           `json:"exit_code" gorm:"uniqueIndex:compositeindex"`
	StartTime               time.Time     `json:"start_time" gorm:"uniqueIndex:compositeindex,index:start_time_index"`
	EndTime                 time.Time     `json:"end_time" gorm:"uniqueIndex:compositeindex,index:end_time_index"`
	DeviceId                string        `json:"device_id" gorm:"uniqueIndex:compositeindex"`
	EntryId                 string        `json:"entry_id" gorm:"uniqueIndex:compositeindex,uniqueIndex:entry_id_index"`
	CustomColumns           CustomColumns `json:"custom_columns"`
}

func DecryptHistoryEntry

func DecryptHistoryEntry(userSecret string, entry shared.EncHistoryEntry) (HistoryEntry, error)

func (*HistoryEntry) GoString

func (h *HistoryEntry) GoString() string

Jump to

Keyboard shortcuts

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