Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDataDirectoryPermissions(configDirectory string) error
- func CheckDirectoryPermissions(directory string) error
- func CountDigits(i int64) (count int)
- func CreateFragmentedMP4(fullName string, fragmentedDuration int64)
- func CreateRecordingPath(directory, fileName string, recordedAt time.Time) (string, error)
- func Decrypt(directoryOrFile string, symmetricKey []byte)
- func DirSize(path string) (int64, error)
- func FindOldestFile(dir string) (oldestFile os.FileInfo, err error)
- func GetDays(files []os.FileInfo, recordingDirectory string, ...) []string
- func GetMediaFormatted(files []os.FileInfo, recordingDirectory string, ...) []models.Media
- func GetSortedDirectory(files []os.FileInfo) []os.FileInfo
- func ImageToBytes(img *image.Image) ([]byte, error)
- func NumberOfFilesInDirectory(path string) int
- func NumberOfMP4sInDirectory(path string) int
- func OpenRecording(directory, name string) (*os.File, error)
- func PrintASCIIArt()
- func PrintConfiguration(configuration *models.Configuration)
- func PrintEnvironmentVariables()
- func RandStringBytesMaskImpr(n int) string
- func RandStringBytesRmndr(n int) string
- func ReadDirectory(directory string) ([]os.FileInfo, error)
- func ReadRecordingDirectory(directory string) ([]os.FileInfo, error)
- func RecordingFileName(timestamp int64, deviceKey string) (string, error)
- func RecordingStartTime(name string) (time.Time, error)
- func RemoveRecording(directory, name string) error
- func ResizeHeightWithAspectRatio(newWidth int, width int, height int) (int, int)
- func ResizeImage(img image.Image, newWidth uint, newHeight uint) (*image.Image, error)
- func ResolveBaseDimensions(baseWidth, baseHeight, width, height int) (int, int)
- func ResolveRecordingPath(directory, name string) (string, error)
- func Unique(intSlice []string) []string
Constants ¶
const MaxUint16 = ^uint16(0)
MaxUint16 - maximum value which can be held in an uint16
const MaxUint8 = ^uint8(0)
MaxUint8 - maximum value which can be held in an uint8
const MinUint16 = 0
MinUint16 - minimum value which can be held in an uint8
const MinUint8 = 0
MinUint8 - minimum value which can be held in an uint8
Variables ¶
var VERSION = "0.0.0"
VERSION is the agent version. It defaults to "0.0.0" for local dev builds and is overridden at build time via:
go build -ldflags "-X github.com/kerberos-io/agent/machinery/src/utils.VERSION=v1.2.3"
Functions ¶
func CountDigits ¶
func CreateFragmentedMP4 ¶
func CreateRecordingPath ¶
func GetMediaFormatted ¶
func GetMediaFormatted(files []os.FileInfo, recordingDirectory string, configuration *models.Configuration, eventFilter models.EventFilter) []models.Media
func NumberOfMP4sInDirectory ¶
NumberOfMP4sInDirectory counts MP4 files, including dated subdirectories.
func PrintASCIIArt ¶
func PrintASCIIArt()
func PrintConfiguration ¶
func PrintConfiguration(configuration *models.Configuration)
func PrintEnvironmentVariables ¶
func PrintEnvironmentVariables()
func RandStringBytesMaskImpr ¶
func RandStringBytesRmndr ¶
func ReadRecordingDirectory ¶
ReadRecordingDirectory returns MP4s with root-relative names, preserving the file information used by the existing sorting and media formatting helpers.
func RemoveRecording ¶
func ResizeImage ¶
func ResolveBaseDimensions ¶
ResolveBaseDimensions resolves the liveview/motion base dimensions for a stream given the (optionally configured) base width/height and the camera's probed source width/height. It returns the width and height that should be stored on the configuration.
The aspect-ratio branch is gated on width>0 && height>0: a not-yet-probed stream has width=height=0, which previously made the ratio +Inf and int(float * +Inf) yield MinInt. That poisoned value, later cast to uint at the ResizeImage call sites, wrapped to ~MaxUint and crashed resize with "makeslice: len out of range". When the source isn't probed yet we fall back to the source dimensions (0,0 -> "auto") instead.
func ResolveRecordingPath ¶
ResolveRecordingPath accepts relative paths from listings and historical basename-only references from upload markers and playback URLs.
Types ¶
This section is empty.