record

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 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 added in v1.5.0

func CommonPath(v string) string

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

func PathAddExtension added in v1.5.0

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 added in v1.2.1

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 added in v1.4.0

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 added in v1.2.0

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

CleanerEntry is a cleaner entry.

type OnSegmentCompleteFunc added in v1.8.3

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

OnSegmentCompleteFunc is the prototype of the function passed as OnSegmentComplete

type OnSegmentCreateFunc added in v1.8.3

type OnSegmentCreateFunc = func(path string)

OnSegmentCreateFunc is the prototype of the function passed as OnSegmentCreate

type Path added in v1.5.0

type Path struct {
	Start time.Time
	Path  string
}

Path is a path of a recording segment.

func (*Path) Decode added in v1.5.0

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

Decode decodes a Path.

func (Path) Encode added in v1.5.0

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