record

package
v0.0.0-...-177ec65 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package record contains the recording system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonPath

func CommonPath(v string) string

CommonPath returns the common path between all segments with given recording path.

func PathAddExtension

func PathAddExtension(path string, format conf.RecordFormat) string

PathAddExtension adds the file extension to path.

Types

type Agent

type Agent struct {
	WriteQueueSize    int
	PathFormat        string
	Format            conf.RecordFormat
	PartDuration      time.Duration
	SegmentDuration   time.Duration
	PathName          string
	Stream            *stream.Stream
	OnSegmentCreate   OnSegmentCreateFunc
	OnSegmentComplete OnSegmentCompleteFunc
	Parent            logger.Writer
	// contains filtered or unexported fields
}

Agent writes recordings to disk.

func (*Agent) Close

func (w *Agent) Close()

Close closes the agent.

func (*Agent) Initialize

func (w *Agent) Initialize()

Initialize initializes Agent.

func (*Agent) Log

func (w *Agent) Log(level logger.Level, format string, args ...interface{})

Log implements logger.Writer.

type Cleaner

type Cleaner struct {
	Entries []CleanerEntry
	Parent  logger.Writer
	// contains filtered or unexported fields
}

Cleaner removes expired recording segments from disk.

func (*Cleaner) Close

func (c *Cleaner) Close()

Close closes the Cleaner.

func (*Cleaner) Initialize

func (c *Cleaner) Initialize()

Initialize initializes a Cleaner.

func (*Cleaner) Log

func (c *Cleaner) Log(level logger.Level, format string, args ...interface{})

Log implements logger.Writer.

type CleanerEntry

type CleanerEntry struct {
	Path        string
	Format      conf.RecordFormat
	DeleteAfter time.Duration
}

CleanerEntry is a cleaner entry.

type OnSegmentCompleteFunc

type OnSegmentCompleteFunc = func(path string, duration time.Duration)

OnSegmentCompleteFunc is the prototype of the function passed as OnSegmentComplete

type OnSegmentCreateFunc

type OnSegmentCreateFunc = func(path string)

OnSegmentCreateFunc is the prototype of the function passed as OnSegmentCreate

type Path

type Path struct {
	Start time.Time
	Path  string
}

Path is a path of a recording segment.

func (*Path) Decode

func (p *Path) Decode(format string, v string) bool

Decode decodes a Path.

func (Path) Encode

func (p Path) Encode(format string) string

Encode encodes a path.

Jump to

Keyboard shortcuts

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