conf

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package conf contains the struct that holds the configuration of the software.

Index

Constants

This section is empty.

Variables

View Source
var ErrPathNotFound = errors.New("path not found")

ErrPathNotFound is returned when a path is not found.

Functions

This section is empty.

Types

type AuthAction added in v1.6.0

type AuthAction string

AuthAction is an authentication action.

const (
	AuthActionPublish  AuthAction = "publish"
	AuthActionRead     AuthAction = "read"
	AuthActionPlayback AuthAction = "playback"
	AuthActionAPI      AuthAction = "api"
	AuthActionMetrics  AuthAction = "metrics"
	AuthActionPprof    AuthAction = "pprof"
)

auth actions

func (AuthAction) MarshalJSON added in v1.6.0

func (d AuthAction) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AuthAction) UnmarshalEnv added in v1.6.0

func (d *AuthAction) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*AuthAction) UnmarshalJSON added in v1.6.0

func (d *AuthAction) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type AuthInternalUser added in v1.6.0

type AuthInternalUser struct {
	User        Credential                   `json:"user"`
	Pass        Credential                   `json:"pass"`
	IPs         IPNetworks                   `json:"ips"`
	Permissions []AuthInternalUserPermission `json:"permissions"`
}

AuthInternalUser is an user.

type AuthInternalUserPermission added in v1.6.0

type AuthInternalUserPermission struct {
	Action AuthAction `json:"action"`
	Path   string     `json:"path"`
}

AuthInternalUserPermission is a permission of a user.

type AuthMethod added in v1.6.0

type AuthMethod int

AuthMethod is an authentication method.

const (
	AuthMethodInternal AuthMethod = iota
	AuthMethodHTTP
	AuthMethodJWT
)

authentication methods.

func (AuthMethod) MarshalJSON added in v1.6.0

func (d AuthMethod) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AuthMethod) UnmarshalEnv added in v1.6.0

func (d *AuthMethod) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*AuthMethod) UnmarshalJSON added in v1.6.0

func (d *AuthMethod) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Conf

type Conf struct {
	// General
	LogLevel            LogLevel        `json:"logLevel"`
	LogDestinations     LogDestinations `json:"logDestinations"`
	LogFile             string          `json:"logFile"`
	ReadTimeout         StringDuration  `json:"readTimeout"`
	WriteTimeout        StringDuration  `json:"writeTimeout"`
	ReadBufferCount     *int            `json:"readBufferCount,omitempty"` // deprecated
	WriteQueueSize      int             `json:"writeQueueSize"`
	UDPMaxPayloadSize   int             `json:"udpMaxPayloadSize"`
	RunOnConnect        string          `json:"runOnConnect"`
	RunOnConnectRestart bool            `json:"runOnConnectRestart"`
	RunOnDisconnect     string          `json:"runOnDisconnect"`

	// Authentication
	AuthMethod                AuthMethod                   `json:"authMethod"`
	AuthInternalUsers         []AuthInternalUser           `json:"authInternalUsers"`
	AuthHTTPAddress           string                       `json:"authHTTPAddress"`
	ExternalAuthenticationURL *string                      `json:"externalAuthenticationURL,omitempty"` // deprecated
	AuthHTTPExclude           []AuthInternalUserPermission `json:"authHTTPExclude"`
	AuthJWTJWKS               string                       `json:"authJWTJWKS"`

	// Control API
	API               bool       `json:"api"`
	APIAddress        string     `json:"apiAddress"`
	APIEncryption     bool       `json:"apiEncryption"`
	APIServerKey      string     `json:"apiServerKey"`
	APIServerCert     string     `json:"apiServerCert"`
	APIAllowOrigin    string     `json:"apiAllowOrigin"`
	APITrustedProxies IPNetworks `json:"apiTrustedProxies"`

	// Metrics
	Metrics               bool       `json:"metrics"`
	MetricsAddress        string     `json:"metricsAddress"`
	MetricsEncryption     bool       `json:"metricsEncryption"`
	MetricsServerKey      string     `json:"metricsServerKey"`
	MetricsServerCert     string     `json:"metricsServerCert"`
	MetricsAllowOrigin    string     `json:"metricsAllowOrigin"`
	MetricsTrustedProxies IPNetworks `json:"metricsTrustedProxies"`

	// PPROF
	PPROF               bool       `json:"pprof"`
	PPROFAddress        string     `json:"pprofAddress"`
	PPROFEncryption     bool       `json:"pprofEncryption"`
	PPROFServerKey      string     `json:"pprofServerKey"`
	PPROFServerCert     string     `json:"pprofServerCert"`
	PPROFAllowOrigin    string     `json:"pprofAllowOrigin"`
	PPROFTrustedProxies IPNetworks `json:"pprofTrustedProxies"`

	// Playback
	Playback               bool       `json:"playback"`
	PlaybackAddress        string     `json:"playbackAddress"`
	PlaybackEncryption     bool       `json:"playbackEncryption"`
	PlaybackServerKey      string     `json:"playbackServerKey"`
	PlaybackServerCert     string     `json:"playbackServerCert"`
	PlaybackAllowOrigin    string     `json:"playbackAllowOrigin"`
	PlaybackTrustedProxies IPNetworks `json:"playbackTrustedProxies"`

	// RTSP server
	RTSP              bool             `json:"rtsp"`
	RTSPDisable       *bool            `json:"rtspDisable,omitempty"` // deprecated
	Protocols         Protocols        `json:"protocols"`
	Encryption        Encryption       `json:"encryption"`
	RTSPAddress       string           `json:"rtspAddress"`
	RTSPSAddress      string           `json:"rtspsAddress"`
	RTPAddress        string           `json:"rtpAddress"`
	RTCPAddress       string           `json:"rtcpAddress"`
	MulticastIPRange  string           `json:"multicastIPRange"`
	MulticastRTPPort  int              `json:"multicastRTPPort"`
	MulticastRTCPPort int              `json:"multicastRTCPPort"`
	ServerKey         string           `json:"serverKey"`
	ServerCert        string           `json:"serverCert"`
	AuthMethods       *RTSPAuthMethods `json:"authMethods,omitempty"` // deprecated
	RTSPAuthMethods   RTSPAuthMethods  `json:"rtspAuthMethods"`

	// RTMP server
	RTMP           bool       `json:"rtmp"`
	RTMPDisable    *bool      `json:"rtmpDisable,omitempty"` // deprecated
	RTMPAddress    string     `json:"rtmpAddress"`
	RTMPEncryption Encryption `json:"rtmpEncryption"`
	RTMPSAddress   string     `json:"rtmpsAddress"`
	RTMPServerKey  string     `json:"rtmpServerKey"`
	RTMPServerCert string     `json:"rtmpServerCert"`

	// HLS server
	HLS                bool           `json:"hls"`
	HLSDisable         *bool          `json:"hlsDisable,omitempty"` // deprecated
	HLSAddress         string         `json:"hlsAddress"`
	HLSEncryption      bool           `json:"hlsEncryption"`
	HLSServerKey       string         `json:"hlsServerKey"`
	HLSServerCert      string         `json:"hlsServerCert"`
	HLSAllowOrigin     string         `json:"hlsAllowOrigin"`
	HLSTrustedProxies  IPNetworks     `json:"hlsTrustedProxies"`
	HLSAlwaysRemux     bool           `json:"hlsAlwaysRemux"`
	HLSVariant         HLSVariant     `json:"hlsVariant"`
	HLSSegmentCount    int            `json:"hlsSegmentCount"`
	HLSSegmentDuration StringDuration `json:"hlsSegmentDuration"`
	HLSPartDuration    StringDuration `json:"hlsPartDuration"`
	HLSSegmentMaxSize  StringSize     `json:"hlsSegmentMaxSize"`
	HLSDirectory       string         `json:"hlsDirectory"`

	// WebRTC server
	WebRTC                      bool              `json:"webrtc"`
	WebRTCDisable               *bool             `json:"webrtcDisable,omitempty"` // deprecated
	WebRTCAddress               string            `json:"webrtcAddress"`
	WebRTCEncryption            bool              `json:"webrtcEncryption"`
	WebRTCServerKey             string            `json:"webrtcServerKey"`
	WebRTCServerCert            string            `json:"webrtcServerCert"`
	WebRTCAllowOrigin           string            `json:"webrtcAllowOrigin"`
	WebRTCTrustedProxies        IPNetworks        `json:"webrtcTrustedProxies"`
	WebRTCLocalUDPAddress       string            `json:"webrtcLocalUDPAddress"`
	WebRTCLocalTCPAddress       string            `json:"webrtcLocalTCPAddress"`
	WebRTCIPsFromInterfaces     bool              `json:"webrtcIPsFromInterfaces"`
	WebRTCIPsFromInterfacesList []string          `json:"webrtcIPsFromInterfacesList"`
	WebRTCAdditionalHosts       []string          `json:"webrtcAdditionalHosts"`
	WebRTCICEServers2           []WebRTCICEServer `json:"webrtcICEServers2"`
	WebRTCICEUDPMuxAddress      *string           `json:"webrtcICEUDPMuxAddress,omitempty"`  // deprecated
	WebRTCICETCPMuxAddress      *string           `json:"webrtcICETCPMuxAddress,omitempty"`  // deprecated
	WebRTCICEHostNAT1To1IPs     *[]string         `json:"webrtcICEHostNAT1To1IPs,omitempty"` // deprecated
	WebRTCICEServers            *[]string         `json:"webrtcICEServers,omitempty"`        // deprecated

	// SRT server
	SRT        bool   `json:"srt"`
	SRTAddress string `json:"srtAddress"`

	// Record (deprecated)
	Record                *bool           `json:"record,omitempty"`                // deprecated
	RecordPath            *string         `json:"recordPath,omitempty"`            // deprecated
	RecordFormat          *RecordFormat   `json:"recordFormat,omitempty"`          // deprecated
	RecordPartDuration    *StringDuration `json:"recordPartDuration,omitempty"`    // deprecated
	RecordSegmentDuration *StringDuration `json:"recordSegmentDuration,omitempty"` // deprecated
	RecordDeleteAfter     *StringDuration `json:"recordDeleteAfter,omitempty"`     // deprecated

	// Path defaults
	PathDefaults Path `json:"pathDefaults"`

	// Paths
	OptionalPaths map[string]*OptionalPath `json:"paths"`
	Paths         map[string]*Path         `json:"-"` // filled by Check()
}

Conf is a configuration.

func Load

func Load(fpath string, defaultConfPaths []string) (*Conf, string, error)

Load loads a Conf.

func (*Conf) AddPath added in v1.2.0

func (conf *Conf) AddPath(name string, p *OptionalPath) error

AddPath adds a path.

func (Conf) Clone

func (conf Conf) Clone() *Conf

Clone clones the configuration.

func (*Conf) Global added in v1.2.0

func (conf *Conf) Global() *Global

Global returns the global part of Conf.

func (*Conf) PatchGlobal added in v1.2.0

func (conf *Conf) PatchGlobal(optional *OptionalGlobal)

PatchGlobal patches the global configuration.

func (*Conf) PatchPath added in v1.2.0

func (conf *Conf) PatchPath(name string, optional2 *OptionalPath) error

PatchPath patches a path.

func (*Conf) PatchPathDefaults added in v1.2.0

func (conf *Conf) PatchPathDefaults(optional *OptionalPath)

PatchPathDefaults patches path default settings.

func (*Conf) RemovePath added in v1.2.0

func (conf *Conf) RemovePath(name string) error

RemovePath removes a path.

func (*Conf) ReplacePath added in v1.2.0

func (conf *Conf) ReplacePath(name string, optional2 *OptionalPath) error

ReplacePath replaces a path.

func (*Conf) UnmarshalJSON

func (conf *Conf) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Conf) Validate added in v1.5.0

func (conf *Conf) Validate() error

Validate checks the configuration for errors.

type Credential

type Credential string

Credential is a parameter that is used as username or password.

func (Credential) Check added in v1.5.0

func (d Credential) Check(guess string) bool

Check returns true if the given value matches the credential.

func (Credential) IsArgon2 added in v1.5.0

func (d Credential) IsArgon2() bool

IsArgon2 returns true if the credential is an argon2 hash.

func (Credential) IsHashed added in v1.5.0

func (d Credential) IsHashed() bool

IsHashed returns true if the credential is a sha256 or argon2 hash.

func (Credential) IsSha256 added in v1.5.0

func (d Credential) IsSha256() bool

IsSha256 returns true if the credential is a sha256 hash.

func (Credential) MarshalJSON

func (d Credential) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Credential) UnmarshalEnv

func (d *Credential) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*Credential) UnmarshalJSON

func (d *Credential) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Encryption

type Encryption int

Encryption is the encryption parameter.

const (
	EncryptionNo Encryption = iota
	EncryptionOptional
	EncryptionStrict
)

values.

func (Encryption) MarshalJSON

func (d Encryption) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Encryption) UnmarshalEnv

func (d *Encryption) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*Encryption) UnmarshalJSON

func (d *Encryption) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Global added in v1.2.0

type Global struct {
	Values interface{}
}

Global is the global part of Conf.

func (*Global) MarshalJSON added in v1.2.0

func (p *Global) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

type HLSVariant

type HLSVariant gohlslib.MuxerVariant

HLSVariant is the hlsVariant parameter.

func (HLSVariant) MarshalJSON

func (d HLSVariant) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*HLSVariant) UnmarshalEnv

func (d *HLSVariant) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*HLSVariant) UnmarshalJSON

func (d *HLSVariant) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IPNetworks added in v1.6.0

type IPNetworks []net.IPNet

IPNetworks is a parameter that contains a list of IP networks.

func (IPNetworks) Contains added in v1.6.0

func (d IPNetworks) Contains(ip net.IP) bool

Contains checks whether the IP is part of one of the networks.

func (IPNetworks) MarshalJSON added in v1.6.0

func (d IPNetworks) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*IPNetworks) ToTrustedProxies added in v1.6.0

func (d *IPNetworks) ToTrustedProxies() []string

ToTrustedProxies converts IPNetworks into a string slice for SetTrustedProxies.

func (*IPNetworks) UnmarshalEnv added in v1.6.0

func (d *IPNetworks) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*IPNetworks) UnmarshalJSON added in v1.6.0

func (d *IPNetworks) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LogDestinations

type LogDestinations []logger.Destination

LogDestinations is the logDestionations parameter.

func (LogDestinations) MarshalJSON

func (d LogDestinations) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*LogDestinations) UnmarshalEnv

func (d *LogDestinations) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*LogDestinations) UnmarshalJSON

func (d *LogDestinations) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LogLevel

type LogLevel logger.Level

LogLevel is the logLevel parameter.

func (LogLevel) MarshalJSON

func (d LogLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*LogLevel) UnmarshalEnv

func (d *LogLevel) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*LogLevel) UnmarshalJSON

func (d *LogLevel) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type OptionalGlobal added in v1.2.0

type OptionalGlobal struct {
	Values interface{}
}

OptionalGlobal is a Conf whose values can all be optional.

func (*OptionalGlobal) MarshalJSON added in v1.2.0

func (p *OptionalGlobal) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*OptionalGlobal) UnmarshalJSON added in v1.2.0

func (p *OptionalGlobal) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type OptionalPath added in v1.2.0

type OptionalPath struct {
	Values interface{}
}

OptionalPath is a Path whose values can all be optional.

func (*OptionalPath) MarshalJSON added in v1.2.0

func (p *OptionalPath) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*OptionalPath) UnmarshalEnv added in v1.2.0

func (p *OptionalPath) UnmarshalEnv(prefix string, _ string) error

UnmarshalEnv implements env.Unmarshaler.

func (*OptionalPath) UnmarshalJSON added in v1.2.0

func (p *OptionalPath) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Path added in v1.2.0

type Path struct {
	Regexp *regexp.Regexp `json:"-"`    // filled by Check()
	Name   string         `json:"name"` // filled by Check()

	// General
	Source                     string         `json:"source"`
	SourceFingerprint          string         `json:"sourceFingerprint"`
	SourceOnDemand             bool           `json:"sourceOnDemand"`
	SourceOnDemandStartTimeout StringDuration `json:"sourceOnDemandStartTimeout"`
	SourceOnDemandCloseAfter   StringDuration `json:"sourceOnDemandCloseAfter"`
	MaxReaders                 int            `json:"maxReaders"`
	SRTReadPassphrase          string         `json:"srtReadPassphrase"`
	Fallback                   string         `json:"fallback"`

	// Record
	Record                bool           `json:"record"`
	Playback              *bool          `json:"playback,omitempty"` // deprecated
	RecordPath            string         `json:"recordPath"`
	RecordFormat          RecordFormat   `json:"recordFormat"`
	RecordPartDuration    StringDuration `json:"recordPartDuration"`
	RecordSegmentDuration StringDuration `json:"recordSegmentDuration"`
	RecordDeleteAfter     StringDuration `json:"recordDeleteAfter"`

	// Authentication (deprecated)
	PublishUser *Credential `json:"publishUser,omitempty"` // deprecated
	PublishPass *Credential `json:"publishPass,omitempty"` // deprecated
	PublishIPs  *IPNetworks `json:"publishIPs,omitempty"`  // deprecated
	ReadUser    *Credential `json:"readUser,omitempty"`    // deprecated
	ReadPass    *Credential `json:"readPass,omitempty"`    // deprecated
	ReadIPs     *IPNetworks `json:"readIPs,omitempty"`     // deprecated

	// Publisher source
	OverridePublisher        bool   `json:"overridePublisher"`
	DisablePublisherOverride *bool  `json:"disablePublisherOverride,omitempty"` // deprecated
	SRTPublishPassphrase     string `json:"srtPublishPassphrase"`

	// RTSP source
	RTSPTransport       RTSPTransport  `json:"rtspTransport"`
	RTSPAnyPort         bool           `json:"rtspAnyPort"`
	SourceProtocol      *RTSPTransport `json:"sourceProtocol,omitempty"`      // deprecated
	SourceAnyPortEnable *bool          `json:"sourceAnyPortEnable,omitempty"` // deprecated
	RTSPRangeType       RTSPRangeType  `json:"rtspRangeType"`
	RTSPRangeStart      string         `json:"rtspRangeStart"`

	// Redirect source
	SourceRedirect string `json:"sourceRedirect"`

	// Raspberry Pi Camera source
	RPICameraCamID             int       `json:"rpiCameraCamID"`
	RPICameraWidth             int       `json:"rpiCameraWidth"`
	RPICameraHeight            int       `json:"rpiCameraHeight"`
	RPICameraHFlip             bool      `json:"rpiCameraHFlip"`
	RPICameraVFlip             bool      `json:"rpiCameraVFlip"`
	RPICameraBrightness        float64   `json:"rpiCameraBrightness"`
	RPICameraContrast          float64   `json:"rpiCameraContrast"`
	RPICameraSaturation        float64   `json:"rpiCameraSaturation"`
	RPICameraSharpness         float64   `json:"rpiCameraSharpness"`
	RPICameraExposure          string    `json:"rpiCameraExposure"`
	RPICameraAWB               string    `json:"rpiCameraAWB"`
	RPICameraAWBGains          []float64 `json:"rpiCameraAWBGains"`
	RPICameraDenoise           string    `json:"rpiCameraDenoise"`
	RPICameraShutter           int       `json:"rpiCameraShutter"`
	RPICameraMetering          string    `json:"rpiCameraMetering"`
	RPICameraGain              float64   `json:"rpiCameraGain"`
	RPICameraEV                float64   `json:"rpiCameraEV"`
	RPICameraROI               string    `json:"rpiCameraROI"`
	RPICameraHDR               bool      `json:"rpiCameraHDR"`
	RPICameraTuningFile        string    `json:"rpiCameraTuningFile"`
	RPICameraMode              string    `json:"rpiCameraMode"`
	RPICameraFPS               float64   `json:"rpiCameraFPS"`
	RPICameraIDRPeriod         int       `json:"rpiCameraIDRPeriod"`
	RPICameraBitrate           int       `json:"rpiCameraBitrate"`
	RPICameraProfile           string    `json:"rpiCameraProfile"`
	RPICameraLevel             string    `json:"rpiCameraLevel"`
	RPICameraAfMode            string    `json:"rpiCameraAfMode"`
	RPICameraAfRange           string    `json:"rpiCameraAfRange"`
	RPICameraAfSpeed           string    `json:"rpiCameraAfSpeed"`
	RPICameraLensPosition      float64   `json:"rpiCameraLensPosition"`
	RPICameraAfWindow          string    `json:"rpiCameraAfWindow"`
	RPICameraTextOverlayEnable bool      `json:"rpiCameraTextOverlayEnable"`
	RPICameraTextOverlay       string    `json:"rpiCameraTextOverlay"`

	// Hooks
	RunOnInit                  string         `json:"runOnInit"`
	RunOnInitRestart           bool           `json:"runOnInitRestart"`
	RunOnDemand                string         `json:"runOnDemand"`
	RunOnDemandRestart         bool           `json:"runOnDemandRestart"`
	RunOnDemandStartTimeout    StringDuration `json:"runOnDemandStartTimeout"`
	RunOnDemandCloseAfter      StringDuration `json:"runOnDemandCloseAfter"`
	RunOnUnDemand              string         `json:"runOnUnDemand"`
	RunOnReady                 string         `json:"runOnReady"`
	RunOnReadyRestart          bool           `json:"runOnReadyRestart"`
	RunOnNotReady              string         `json:"runOnNotReady"`
	RunOnRead                  string         `json:"runOnRead"`
	RunOnReadRestart           bool           `json:"runOnReadRestart"`
	RunOnUnread                string         `json:"runOnUnread"`
	RunOnRecordSegmentCreate   string         `json:"runOnRecordSegmentCreate"`
	RunOnRecordSegmentComplete string         `json:"runOnRecordSegmentComplete"`
}

Path is a path configuration.

func FindPathConf added in v1.5.0

func FindPathConf(pathConfs map[string]*Path, name string) (string, *Path, []string, error)

FindPathConf returns the configuration corresponding to the given path name.

func (Path) Clone added in v1.2.0

func (pconf Path) Clone() *Path

Clone clones the configuration.

func (*Path) Equal added in v1.2.0

func (pconf *Path) Equal(other *Path) bool

Equal checks whether two Paths are equal.

func (Path) HasOnDemandPublisher added in v1.2.0

func (pconf Path) HasOnDemandPublisher() bool

HasOnDemandPublisher checks whether the path has a on-demand publisher.

func (Path) HasOnDemandStaticSource added in v1.2.0

func (pconf Path) HasOnDemandStaticSource() bool

HasOnDemandStaticSource checks whether the path has a on demand static source.

func (Path) HasStaticSource added in v1.2.0

func (pconf Path) HasStaticSource() bool

HasStaticSource checks whether the path has a static source.

type Protocol

type Protocol gortsplib.Transport

Protocol is a RTSP transport.

type Protocols

type Protocols map[Protocol]struct{}

Protocols is the protocols parameter.

func (Protocols) MarshalJSON

func (d Protocols) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Protocols) UnmarshalEnv

func (d *Protocols) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*Protocols) UnmarshalJSON

func (d *Protocols) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RTSPAuthMethods added in v1.6.0

type RTSPAuthMethods []headers.AuthMethod

RTSPAuthMethods is the rtspAuthMethods parameter.

func (RTSPAuthMethods) MarshalJSON added in v1.6.0

func (d RTSPAuthMethods) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RTSPAuthMethods) UnmarshalEnv added in v1.6.0

func (d *RTSPAuthMethods) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*RTSPAuthMethods) UnmarshalJSON added in v1.6.0

func (d *RTSPAuthMethods) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RTSPRangeType added in v1.1.1

type RTSPRangeType int

RTSPRangeType is the type used in the Range header.

const (
	RTSPRangeTypeUndefined RTSPRangeType = iota
	RTSPRangeTypeClock
	RTSPRangeTypeNPT
	RTSPRangeTypeSMPTE
)

supported values.

func (RTSPRangeType) MarshalJSON added in v1.1.1

func (d RTSPRangeType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RTSPRangeType) UnmarshalEnv added in v1.1.1

func (d *RTSPRangeType) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*RTSPRangeType) UnmarshalJSON added in v1.1.1

func (d *RTSPRangeType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RTSPTransport added in v1.3.0

type RTSPTransport struct {
	*gortsplib.Transport
}

RTSPTransport is the rtspTransport parameter.

func (RTSPTransport) MarshalJSON added in v1.3.0

func (d RTSPTransport) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RTSPTransport) UnmarshalEnv added in v1.3.0

func (d *RTSPTransport) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*RTSPTransport) UnmarshalJSON added in v1.3.0

func (d *RTSPTransport) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RecordFormat added in v1.2.0

type RecordFormat int

RecordFormat is the recordFormat parameter.

const (
	RecordFormatFMP4 RecordFormat = iota
	RecordFormatMPEGTS
)

supported values.

func (RecordFormat) MarshalJSON added in v1.2.0

func (d RecordFormat) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RecordFormat) UnmarshalEnv added in v1.2.0

func (d *RecordFormat) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*RecordFormat) UnmarshalJSON added in v1.2.0

func (d *RecordFormat) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StringDuration

type StringDuration time.Duration

StringDuration is a duration that is unmarshaled from a string. Durations are normally unmarshaled from numbers.

func (StringDuration) MarshalJSON

func (d StringDuration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*StringDuration) UnmarshalEnv

func (d *StringDuration) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*StringDuration) UnmarshalJSON

func (d *StringDuration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type StringSize

type StringSize uint64

StringSize is a size that is unmarshaled from a string.

func (StringSize) MarshalJSON

func (s StringSize) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*StringSize) UnmarshalEnv

func (s *StringSize) UnmarshalEnv(_ string, v string) error

UnmarshalEnv implements env.Unmarshaler.

func (*StringSize) UnmarshalJSON

func (s *StringSize) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type WebRTCICEServer added in v0.23.7

type WebRTCICEServer struct {
	URL        string `json:"url"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	ClientOnly bool   `json:"clientOnly"`
}

WebRTCICEServer is a WebRTC ICE Server.

Directories

Path Synopsis
Package decrypt contains the Decrypt function.
Package decrypt contains the Decrypt function.
Package env contains a function to load configuration from environment.
Package env contains a function to load configuration from environment.
Package yaml contains a yaml loader.
Package yaml contains a yaml loader.

Jump to

Keyboard shortcuts

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