conf

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPathName

func CheckPathName(name string) error

CheckPathName checks if a path name is valid.

Types

type Conf

type Conf struct {
	// general
	LogLevel              string                          `yaml:"logLevel"`
	LogLevelParsed        logger.Level                    `yaml:"-" json:"-"`
	LogDestinations       []string                        `yaml:"logDestinations"`
	LogDestinationsParsed map[logger.Destination]struct{} `yaml:"-" json:"-"`
	LogFile               string                          `yaml:"logFile"`
	ListenIP              string                          `yaml:"listenIP"`
	ReadTimeout           time.Duration                   `yaml:"readTimeout"`
	WriteTimeout          time.Duration                   `yaml:"writeTimeout"`
	ReadBufferCount       int                             `yaml:"readBufferCount"`
	Metrics               bool                            `yaml:"metrics"`
	MetricsPort           int                             `yaml:"metricsPort"`
	Pprof                 bool                            `yaml:"pprof"`
	RunOnConnect          string                          `yaml:"runOnConnect"`
	RunOnConnectRestart   bool                            `yaml:"runOnConnectRestart"`

	// rtsp
	RTSPDisable       bool                                  `yaml:"rtspDisable"`
	Protocols         []string                              `yaml:"protocols"`
	ProtocolsParsed   map[gortsplib.StreamProtocol]struct{} `yaml:"-" json:"-"`
	Encryption        string                                `yaml:"encryption"`
	EncryptionParsed  Encryption                            `yaml:"-" json:"-"`
	RTSPPort          int                                   `yaml:"rtspPort"`
	RTSPSPort         int                                   `yaml:"rtspsPort"`
	RTPPort           int                                   `yaml:"rtpPort"`
	RTCPPort          int                                   `yaml:"rtcpPort"`
	ServerKey         string                                `yaml:"serverKey"`
	ServerCert        string                                `yaml:"serverCert"`
	AuthMethods       []string                              `yaml:"authMethods"`
	AuthMethodsParsed []headers.AuthMethod                  `yaml:"-" json:"-"`
	ReadBufferSize    int                                   `yaml:"readBufferSize"`

	// rtmp
	RTMPDisable bool `yaml:"rtmpDisable"`
	RTMPPort    int  `yaml:"rtmpPort"`

	// path
	Paths map[string]*PathConf `yaml:"paths"`
}

Conf is the main program configuration.

func Load

func Load(fpath string) (*Conf, bool, error)

Load loads a Conf.

type Encryption

type Encryption int

Encryption is an encryption policy.

const (
	EncryptionNo Encryption = iota
	EncryptionOptional
	EncryptionStrict
)

encryption policies.

type PathConf

type PathConf struct {
	Regexp                     *regexp.Regexp            `yaml:"-" json:"-"`
	Source                     string                    `yaml:"source"`
	SourceProtocol             string                    `yaml:"sourceProtocol"`
	SourceProtocolParsed       *gortsplib.StreamProtocol `yaml:"-" json:"-"`
	SourceOnDemand             bool                      `yaml:"sourceOnDemand"`
	SourceOnDemandStartTimeout time.Duration             `yaml:"sourceOnDemandStartTimeout"`
	SourceOnDemandCloseAfter   time.Duration             `yaml:"sourceOnDemandCloseAfter"`
	SourceRedirect             string                    `yaml:"sourceRedirect"`
	Fallback                   string                    `yaml:"fallback"`
	RunOnInit                  string                    `yaml:"runOnInit"`
	RunOnInitRestart           bool                      `yaml:"runOnInitRestart"`
	RunOnDemand                string                    `yaml:"runOnDemand"`
	RunOnDemandRestart         bool                      `yaml:"runOnDemandRestart"`
	RunOnDemandStartTimeout    time.Duration             `yaml:"runOnDemandStartTimeout"`
	RunOnDemandCloseAfter      time.Duration             `yaml:"runOnDemandCloseAfter"`
	RunOnPublish               string                    `yaml:"runOnPublish"`
	RunOnPublishRestart        bool                      `yaml:"runOnPublishRestart"`
	RunOnRead                  string                    `yaml:"runOnRead"`
	RunOnReadRestart           bool                      `yaml:"runOnReadRestart"`
	PublishUser                string                    `yaml:"publishUser"`
	PublishPass                string                    `yaml:"publishPass"`
	PublishIps                 []string                  `yaml:"publishIps"`
	PublishIpsParsed           []interface{}             `yaml:"-" json:"-"`
	ReadUser                   string                    `yaml:"readUser"`
	ReadPass                   string                    `yaml:"readPass"`
	ReadIps                    []string                  `yaml:"readIps"`
	ReadIpsParsed              []interface{}             `yaml:"-" json:"-"`
}

PathConf is a path configuration.

func (*PathConf) Equal

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

Equal checks whether two PathConfs are equal.

Jump to

Keyboard shortcuts

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